Advertisement
GCK

GCK/Coin_flip function

GCK
Sep 17th, 2019
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.21 KB | None | 0 0
  1. def coin_flip():
  2.     #heads =0 and tails =1
  3.     generated=random.randint(0,2)
  4.     print("heads or tails?")
  5.     if generated==0:
  6.         print("heads")
  7.     elif generated==1:
  8.         print("tails")
  9.  
  10.  
  11. coin_flip()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement