Python Forum
i've got these very simple homework
Thread Rating:
  • 1 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
i've got these very simple homework
#1
my mind is not always the best so i hope you could help me with this:

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:
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 
TNX

edit:
the solution should be without a 'list'
Reply


Messages In This Thread
i've got these very simple homework - by HakolYahol - Aug-07-2018, 07:43 AM
RE: i've got these very simple homework - by wavic - Aug-07-2018, 08:31 AM
RE: i've got these very simple homework - by woooee - Aug-07-2018, 05:15 PM
RE: i've got these very simple homework - by buran - Aug-07-2018, 05:23 PM
RE: i've got these very simple homework - by buran - Aug-08-2018, 11:57 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Where can I get loooads of simple homework questions for kids? omar 1 995 Nov-09-2022, 02:33 PM
Last Post: Larz60+
  [TkInter]Simple Python Homework zaji_123 4 4,093 Jan-01-2021, 07:09 PM
Last Post: EliesBe
  Please help. Simple homework Asm0deus314 3 3,403 Feb-02-2020, 07:03 PM
Last Post: michael1789
  Homework Help - Simple Grading System Segovia 7 7,829 Jul-24-2018, 10:55 PM
Last Post: Segovia

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020