anyone tell me why my program will not run?

Dylan Riley dylan.riley at hotmail.com
Fri Nov 20 22:30:02 EST 2015


i am learning python and was tasked with making a program that flips a coin 100 times and then tells you
the number of heads and tails.

I have done so coming up with this piece of work but it doesnt run can anyone help me out?

#This is credited to dylan

print(" \\ \\ \\ \\ \\ \\ \\ \\ D FLIPS \\ \\ \\ \\ \\ \\ \\ \\")
print("\n\nThis is D's coin flipper program. You get 100 flips. \n\t LETS SEE HOW LUCKY YOU ARE")
input("Press enter")

import random

heads = int("1")
tails = int("2")
flips = 100
headscount = 0
tailscount = 0

while flips != 0:
    flips -= 1

result = random.randint(heads, tails)
if result = heads:
    headscount += 1
else:
    tailscount += 1


print(headscount, tailscount)

input("press enter to exit")



More information about the Python-list mailing list