Aug-07-2018, 07:43 AM
(This post was last modified: Aug-07-2018, 07:43 AM by HakolYahol.)
my mind is not always the best so i hope you could help me with this:
i could only come up with this start:
TNX
edit:
the solution should be without a 'list'
Quote:Write a program that simulates a fortune cookie. The program
should display one of five unique fortunes, at random, each
time it’s run.
i could only come up with this start:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
import random # list of furtune cookie sayings one = "For hate is never conquered by hate. Hate is conquered by love ." two = "Your worst enemy has a crush on you!" three = "You will make many changes before settling down happily." four = "If you have something worth fighting for, then fight for it." five = "In music, one must think with his heart and feel with his brain." # choosing one randomly cookie = random.randint( 1 , 5 ) if cookie |
edit:
the solution should be without a 'list'