Advertisement
rdhammack

Fortune Teller Program in Python

Feb 5th, 2017
475
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.96 KB | None | 0 0
  1. #Fortune Teller
  2. #
  3. #Dustin Hammack
  4. #Feb. 4, 2017
  5.  
  6. print('\n\n\t\tWell hello there! My name is GENIE and I am here to read your ')
  7. print('\t\tfotune, and as a bonus, I will also read you your lucky numbers.')
  8. print()
  9. print()
  10.  
  11. import random
  12.  
  13. name = input('What is your name? ')
  14. print(input('\n' + name + ', please press enter to get your fortune and set of lucky numbers \n\n'))
  15.  
  16. def fortuneTeller():
  17.     a = '"Today is the day to show someone you care."'
  18.     b = '"You can create your own happiness."'
  19.     c = '"Mistakes happen.. Turn them into opportunities."'
  20.     d = '"It\'s not about the destination, it\'s about the journey."'
  21.     e = '"Take the time to invest in yourself today"'
  22.     f = '"There are high hopes for your future."'
  23.     g = '"It\'s ok to talk to strangers."'
  24.     h = '"Love is like oxygen, you need it to survive."'
  25.     i = '"May your cookie jar overflow with goodies."'
  26.     j = '"Life\'s journey is always an adventure."'
  27.     k = '"You can create your own happiness."'
  28.     l = '"Say yes to exciting opportunites."'
  29.     m = '"You won\'t know until you try."'
  30.     n = '"There is great love in your future."'
  31.     o = '"May life throw you a pleasant curve."'
  32.     p = '"You will live a long and happy life."'
  33.     q = '"A single kind word can keep one warm for years."'
  34.     r = '"All people smile in the same language."'
  35.     s = '"Before honor is humility."'
  36.     t = '"The time is right to make new friens."'
  37.     u = '"Do not mistake temptation for opportunity."'
  38.     v = '"To love is to forgive."'
  39.     w = '"Do everything with confidence."'
  40.     x = '"Friendships are made, not discovered."'
  41.     y = '"Good ideas come free of charge."'
  42.     z = '"In the middle of difficulty lies opportunity."'
  43.     aa = '"A new challenge is near."'
  44.     bb = '"To ever become a leader, one must first be a follower."'
  45.     cc = '"Take advantage of your great imagination. It will serve you well."'
  46.     dd = '"Skill comes from diligence."'
  47.     ee = '"Birds are entangled by their feet and men by their tongues."'
  48.  
  49.     fortuneList = [a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,bb,cc,dd,ee]
  50.     listIndex = random.randrange(0 , 31)
  51.     fortune = fortuneList[listIndex]
  52.  
  53.     lucky_1 = random.randrange(1 , 99)
  54.     lucky_2 = random.randrange(1 , 99)
  55.     lucky_3 = random.randrange(1 , 99)
  56.     lucky_4 = random.randrange(1 , 99)
  57.     lucky_5 = random.randrange(1 , 99)
  58.     lucky_6 = random.randrange(1 , 99)
  59.  
  60.     luckyNumbersList = [lucky_1 , lucky_2 , lucky_3 , lucky_4 , lucky_5 , lucky_6]
  61.  
  62.     print('\n' + name + 's Fortune is: \n' + fortune)
  63.     print('Your lucky numbers are ' + str(luckyNumbersList))
  64.     playAgain()
  65.    
  66. def playAgain():
  67.     again = input('\n\nWould you like another fortune? ')
  68.     tryAgain = again.lower()
  69.     if (tryAgain == 'yes'):
  70.         fortuneTeller()
  71.     elif (tryAgain == 'no'):
  72.         print('\nMay peace be with you ' + name)
  73.     else:
  74.         print('\nPlease enter YES or NO\n')
  75.         playAgain()
  76.  
  77.  
  78.  
  79. fortuneTeller()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement