Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- money = 100
- #Write your game of chance functions here
- def coin_flip(guess,bet):
- total=100
- guess=input("Call Heads or Tails")
- bet=(input("Place your bet")
- guessin=0
- if guess=="Heads"
- guessin=1
- elif guess=="Tails"
- guessin=1
- else:
- print("Please input \'Heads\' or \'Tails\'")
- actual_flip=random.randint(0,1)
- if actual_flip==guessin:
- return total+bet
- elif actual_flip!=guessin:
- return total-bet
- print(coin_flip(5))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement