This is just the source code. I've been teaching myself Python and I've been creating little programs like this.


Python Code:
  1. import random
  2.  
  3. coins = 100
  4. r = random
  5. reels = []
  6.  
  7. def set_dic():
  8.     reems = [("Cherry | Cherry | Cherry", 5),
  9.   ("Bar | Bar | Bar", 15),
  10.   ("7 | 7 | 7", 30),
  11.   ("Cherry | Bar | 7", 0),
  12.   ("Cherry | 7 | Bar", 0),
  13.   ("Cherry | Cherry | 7", 2),
  14.   ("Cherry | Cherry | Bar", 2),
  15.   ("7 | Cherry | Bar", 0),
  16.   ("7 | Bar | Cherry", 0),
  17.   ("7 | 7 | Cherry", 0),
  18.   ("7 | 7 | Bar", 0),
  19.   ("Bar | 7 | Cherry", 0),
  20.   ("Bar | Cherry | 7", 0),
  21.   ("Bar | Bar | Cherry", 0),
  22.   ("Bar | Bar | 7", 0)]
  23.  
  24.     return reems
  25.    
  26. def balance():
  27.     print ("Your current coin balance is: " + str(coins))
  28.     print ()
  29.  
  30. def instructions():
  31.     print ("Instructions:")
  32.     print ("To view your balance type: b")
  33.     print ("To view these instructions type: d")
  34.     print ("To spin the slot machine type: p")
  35.     print ()
  36.    
  37. def pull():
  38.     spinned_reel = r.choice(reels)
  39.     print (spinned_reel[0])
  40.     return spinned_reel[1]
  41.    
  42. reels = set_dic()
  43. instructions()
  44. while coins > 0:
  45.     response = input()
  46.     if response == "b":
  47.         balance()
  48.     elif response == "d":
  49.         instructions()
  50.     elif response == "p":
  51.         coins -= 5
  52.         coins += pull()
  53.     else:
  54.         print ("Invalid Input")