Guest User

Coin Flip

a guest
Jul 3rd, 2012
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.25 KB | None | 0 0
  1. import random
  2. coin = random.randint(1,2)
  3. heads = 0
  4. tails = 0
  5.  
  6. while heads + tails != 100:
  7.     print(coin)
  8.     if coin == 1:
  9.         heads += 1
  10.  
  11.     if coin == 2:
  12.         tails += 1
  13.  
  14. print("You flipped",heads,"heads and",tails,"tails.")
Advertisement
Add Comment
Please, Sign In to add comment