Commit: d31895fd5ed66e4d0aae4011f1fcceb9cd3bf7a9 Parent: 2f1021eeb8d35ffe68036f8440d44c9e64185fef Author: Vi Grey Date: 2017-10-13 04:22 UTC Summary: Change comments to be better descriptions fairflip.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fairflip.py b/fairflip.py index 74c2d90..dabaf41 100644 --- a/fairflip.py +++ b/fairflip.py @@ -7,9 +7,9 @@ while heads_percent > 0 and heads_percent < 100: # Loop if valid heads_percent # If random number is under heads_percent, then flip is HEADS flip1 = heads_percent > random.randint(0, 100) # True if HEADS result flip2 = heads_percent > random.randint(0, 100) # True if HEADS result - if flip1 != flip2: # Continue loop if flip1 and flip2 are the same - if flip1: # If first flip is HEADS + if flip1 != flip2: # Restart loop if flip1 and flip2 are the same + if flip1: # If first flip is HEADS, print HEADS print("HEADS") - else: # If first flip is TAILS + else: # If first flip is TAILS, print TAILS print("TAILS") break # break out of infinite loop