I Haz Codes

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Menu
What is the punch line?

Create two lists. One list will contain jokes and the other has the punchlines of the jokes.

Take the code below and add the following –

  • Add two more jokes.
  • Pick a random number from 1 to 4 (using random.randint()) and store it in a variable.
  • display the joke using the random number.
  • Have either a input or time.sleep() to pause the program.
  • Display the punchline at the same position.
joke = ["Why did the programmer use the entire bottle of shampoo during one shower? ", "Why can't cats work on the computer? "]
punchline = ["Because the bottle said Lather, Rinse, Repeat.", "They get too distracted chasing the mouse around. "]

 

Leave a Reply

Your email address will not be published. Required fields are marked *

Information