anyone tell me why my program will not run?
Joel Goldstick
joel.goldstick at gmail.com
Fri Nov 20 22:39:22 EST 2015
On Fri, Nov 20, 2015 at 10:30 PM, Dylan Riley <dylan.riley at hotmail.com>
wrote:
> 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
>
> shouldn't this below be in the while loop?
> result = random.randint(heads, tails)
> if result = heads:
> headscount += 1
> else:
> tailscount += 1
>
>
> up to here
> print(headscount, tailscount)
>
> input("press enter to exit")
> --
> https://mail.python.org/mailman/listinfo/python-list
>
--
Joel Goldstick
http://joelgoldstick.com/stats/birthdays
More information about the Python-list
mailing list