Advertisement
Guest User

Untitled

a guest
Nov 19th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. import random
  2.  
  3. money = 100
  4.  
  5. #Write your game of chance functions here
  6.  
  7. def coin_flip(guess,bet):
  8. total=100
  9. guess=input("Call Heads or Tails")
  10. bet=(input("Place your bet")
  11. guessin=0
  12.  
  13. if guess=="Heads"
  14. guessin=1
  15. elif guess=="Tails"
  16. guessin=1
  17. else:
  18. print("Please input \'Heads\' or \'Tails\'")
  19.  
  20. actual_flip=random.randint(0,1)
  21.  
  22. if actual_flip==guessin:
  23. return total+bet
  24. elif actual_flip!=guessin:
  25. return total-bet
  26.  
  27. print(coin_flip(5))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement