Hi,

I'm writing a program that is a program that flips a coin 100 times and
then tells the number of heads and tails.

-------------------------------------------------------------------------------------------------------------------------------------------

import random

head = 0
tail = 0
coin = random.randrange(2)

while (head + tail) < 100:
    if coin == 0:
        print "head"
        head += 1

    elif coin == 1:
        print "tail"
        tail += 1

    else:
        print "Error"


raw_input("")

-------------------------------------------------------------------------------------------------------------------------------------------

The problem is the program prints like..
tail
tail
tail
.
.
.

Help me!

_________________________________________________________________
Don't just search. Find. Check out the new MSN Search! 
http://search.msn.com/

_______________________________________________
Tutor maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/tutor

Reply via email to