Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- heads = 0
- tails = 0
- #this is a loop, so everything in here gets re-called everytime
- # you used to only call randint() once
- while heads + tails != 100:
- coin = random.randint(1,2)
- print(coin)
- if coin == 1:
- heads += 1
- elif coin == 2:
- tails += 1
- print("You flipped",heads,"heads and",tails,"tails.")
Advertisement
Add Comment
Please, Sign In to add comment