Re: [Tutor] While Loops: Coin Flip Game :p:

2010-11-15 Thread Nithya Nisha
Hi Tom, Your code is almost correct. Little mistake is there.The random number generate should be in while loop. > import random > > # set the coin > headsCount = 0 > tailsCount = 0 > count = 0 > > # the loop > while count < 100: #If you declare

Re: [Tutor] While Loops: Coin Flip Game :p:

2010-11-15 Thread Nithya Nisha
Hi Tom, Your code is almost correct. Little mistake is there.The random number generate should be in while loop. > import random > > # set the coin > headsCount = 0 > tailsCount = 0 > count = 0 > > # the loop > while count < 100: #If you declare count = 0. The while loo

Re: [Tutor] While Loops: Coin Flip Game :p:

2010-11-16 Thread Nithya Nisha
Hi there, This is the Code. Please check it.It is working fine. >>>import random >>>headsCount = 0 >>>tailsCount = 0 >>>count = 1 >>> >>>while count <= 100: >>> coin = random.randrange(2) >>> if coin == 0: >>> headsCount += 1 >>> else: >>> tailsCount += 1

Re: [Tutor] While Loops: Coin Flip Game :p:

2010-11-16 Thread Nithya Nisha
nderstand it. > Wing picked up the spacing and I had already corrected > that Dave as I was simply looking at Nithya code. > > > On 16 November 2010 19:10, Nithya Nisha wrote: > >> Hi there, >> >> This is the Code. Please check it.It is working fine