SHARE
TWEET

Untitled

a guest Nov 19th, 2019 86 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top