OK so this is the result after I taking everything I'm teached in this
thread:
print 'Predict Head or Tail in ten times coin thrown\nJust input \'h\'
or \'t\' please\n'
count = 0
user_input = []
while len(user_input) < 10:
print '\nNo.', len(user_input)+1, ', h or t?'
pre_user = raw_inp
Steve Holden thank you for your kind words, they pumped me up:)
I don't really know much about TDD however I googled it and found this:
http://www.agiledata.org/essays/tdd.html
Which is obvious too complicated. However I'll read through it anyway.
Thank you for your advice:)
Ant thank you for poin
> # Get a list which contains 10 values from the user
> # let them predict Head Or Tail in ten times coin thrown
> # and then prdict the list by a fixed rule
>
>
> list = []
>
> print 'Predict Head or Tail in ten times coin thrown\nJust input \'h\'
> or \'t\' please\n'
>
> count = 0
> while True:
Camellia wrote:
> Oh I get it and ashamed, thank you for explaining it to me:)
>
> so I sould:
> ini_guess=random.randrange(2)
>
> for item in list:
> if item=='h':
> ...
> if item ==t':
> ...
>
Welcome to programming. You have learned, as many thousands have learned
Oh I get it and ashamed, thank you for explaining it to me:)
so I sould:
ini_guess=random.randrange(2)
...
for item in list:
if item=='h':
...
if item ==t':
...
[EMAIL PROTECTED] wrote:
> Camellia wrote:
> > Well...It' doesn't, have you run it yet?
>
> Yes it does, and ru
Camellia wrote:
> Well...It' doesn't, have you run it yet?
Yes it does, and running it reflects that behavior.
> ini_guess = random.randrange(1)
> list_guess = ['t', 'h']
> ini_guess = list_guess[ini_guess]
random.randrange(1) will always return 0, so this will always
initialize ini_guess to 't'
Well...It' doesn't, have you run it yet?
its hypothesis is people don't predict a set of things randomly.
Oxyd wrote:
> Um... It looks to me like it just counts the number of times you
> entered 't'...
--
http://mail.python.org/mailman/listinfo/python-list
Um... It looks to me like it just counts the number of times you
entered 't'...
--
http://mail.python.org/mailman/listinfo/python-list
Hi there this is an easy game which was inspired from my psychology
class.
I'll get 5/10 right prediction of your guess of head and tail at most
time.
If you could copy the code and run it that would be great:)
code:
---
# Head or Tail
#
# Get a list which contains 10 values f