Back

Code Challenge: Mad Lib

Difficulty  

divider

Objective

Build a console-based mad lib game.

A mad lib is a word game where players fill in blanks with random words — like nouns, verbs, or places — to complete a silly story. The result is often weird, funny, and totally unexpected.

Skills to Practice

  • Asking the user for input
  • Storing input in a variable
  • Using variables to format and display output

Tasks

  • Create a new Python program named cc-mad-lib.
  • Print a story title at the start of your program.
  • Ask the user to enter at least 5 words (for example: a noun, a verb, an adjective).
  • Insert those words into a pre-written story template.
  • Print the completed story in a fun, readable format.

Sample Output

Sample Output
--- The Wonderful Journey ---
Enter a noun: Nintendo Entertainment System [Enter]
Enter an adjective: smelly [Enter]
Enter a verb: jump [Enter]
Enter another noun: hot dog [Enter]
Enter an adverb: suspiciously [Enter]
Here is your story:
Once upon a time, a smelly Nintendo Entertainment System decided to jump.
On its journey, it found a mysterious hot dog.
The Nintendo Entertainment System and the hot dog became friends.
Together, they jumped suspiciously into the sunset and lived happily ever
after.

Commence Challenge