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
#4
using list and random.choice()
import random
 
cookies = ["For hate is never conquered by hate. Hate is conquered by love.", 
           "Your worst enemy has a crush on you!", 
           "You will make many changes before settling down happily.", 
           "If you have something worth fighting for, then fight for it.", 
           "In music, one must think with his heart and feel with his brain."]
 
# choosing one randomly
cookie = random.choice(cookies)
print(cookie)
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

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 1,024 Nov-09-2022, 02:33 PM
Last Post: Larz60+
  [TkInter]Simple Python Homework zaji_123 4 4,135 Jan-01-2021, 07:09 PM
Last Post: EliesBe
  Please help. Simple homework Asm0deus314 3 3,444 Feb-02-2020, 07:03 PM
Last Post: michael1789
  Homework Help - Simple Grading System Segovia 7 7,907 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