this is the program i wrote
print ("\n\COIN TOSS SIMULATION MENU")
print ("\t--------------------------------------")
print ("\ta)Simulate 100 coin Tosses")
print ("\tq)Quit the program")
selection = input("\n\tPlease make a selection: ")
if(selection == 'a'):
import random
count = 0
heads = 0
tails = 0
while count < 0
flip = random.randrange (0,1)
if flip == 1
heads ==1
print "heads"
elif flip == 0
tails += 1
print "tails"
print ("COIN TOSS STATISTICS")
print ("---------------------")
print("Result")
print("----------")
print("Number of heads:")
print heads
print("Number of tails:")
print tails
elif (selection == 'q');
print (\n\n "press any keys to exit")

New Topic/Question
Reply



MultiQuote






|