Aug-08-2018, 10:16 AM
(This post was last modified: Aug-08-2018, 10:48 AM by HakolYahol.)
thank you both very much.
the first option is what i was needed
:)
ok, i've tried to write it but i get an error. can you tell me why?
the first option is what i was needed
:)
ok, i've tried to write it but i get an error. can you tell me why?
File "fortune_cookie.py", line 11 elif cookie == 2: ^ SyntaxError: invalid syntax
# Write a program that simulates a fortune cookie. The program # should display one of five unique fortunes, at random, each # time it’s run. import random cookie = random.randint(1, 5) if cookie == 1: print("For hate is never conquered by hate. Hate is conquered by love." elif cookie == 2: print("Your worst enemy has a crush on you!") elif cookie == 3: print("You will make many changes before settling down happily.") elif cookie == 4: print("If you have something worth fighting for, then fight for it.") elif cookie == 5: print("In music, one must think with his heart and feel with his brain.") input("\n\nPress the enter key to exit.")i was sure it would work