On суббота, 21 ноября 2015 г. 6:30:02 MSK, Dylan Riley wrote:

Also some more notes:

heads = int("1")
tails = int("2")

Why use this strange initialization? The usual way:
heads = 1
tails = 2
gives the same result.

while flips != 0:
    flips -= 1

There's no need to use while and flips variable:

for _ in range(100):
   if random.randint(heads, tails) == heads:
       headscount += 1
   else:
       tailscount += 1
Also, it's good to put import at the beginning.
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to