Advertisement
jinglis

Fortune Cookie Program

Sep 30th, 2014
333
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.06 KB | None | 0 0
  1. # Name: James Inglis
  2. # Course: Robotics Programming
  3. # Professor: Ms.Stockbridge
  4. # Date: 9/30/14
  5. # Description: This program simulates an opening of a fortune cookie.
  6. #              picks randomly 1 out of the five fortunes everytime the program
  7. #              the program is running.
  8. #
  9.  
  10.  
  11.  
  12. import random
  13.  
  14.  
  15. num = random.randint(1, 5)
  16.  
  17.  
  18. if num == 1:
  19.         string_1 = "Now is the time to try something new."
  20.         print("Here is your fortune: ", string_1)
  21.  
  22. elif num == 2:
  23.         string_2 = "The great joy in life is doing what people say you cannot do."
  24.         print("Here is your fortune: ", string_2)
  25.  
  26. elif num == 3:
  27.         string_3 = "You will find a treasure at this web site."
  28.         print("Here is your fortune: ", string_3)
  29.  
  30. elif num == 4:
  31.         string_4 = "Your dearest wish will come true."
  32.         print("Here is your fortune: ", string_4)
  33.              
  34. else:
  35.     string_5 = "You will have a fine capacity for the enjoyment of life."
  36.     print("Here is your fortune: ", string_5)
  37.  
  38.  
  39.     input("\n\nPress any key to continue!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement