In <[email protected]> Dylan Riley
<[email protected]> writes:
> heads = int("1")
Why are you taking the int value of a string constant? If you know you
want the value 1, why not just use it directly?
> flips = 100
> headscount = 0
> tailscount = 0
> while flips != 0:
> flips -= 1
This loop has no other effect than to set flips to zero, so why not just
set flips to zero in the first place?
> result = random.randint(heads, tails)
> if result = heads:
> headscount += 1
> else:
> tailscount += 1
Perhaps you meant to have this piece of code indented under the while
loop above?
--
John Gordon A is for Amy, who fell down the stairs
[email protected] B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"
--
https://mail.python.org/mailman/listinfo/python-list