1) What do I need to do?
π― Your mission: Your silly story
Ask for at least 5 words with input().
Print a story of at least 3 lines that uses every word.
Bonus: use a loop to let them play again!
2) What do I need to know?
How Mad Libs works
Ask the player for random words β a noun, a verb, an adjective, a number β without telling them the story.
Then put the words into a story with f-strings. The result is usually hilarious!
A noun is a thing (banana). A verb is an action (dance). An adjective describes something (sparkly).
π§° Your toolkit for this mission
Everything you need to know to finish this lesson on your own:
Collect words
Ask for each word with input() and store it.
How to write it: One variable per word.
noun = input("A noun: ")
verb = input("A verb: ")Build the story
Join your text and the words.
How to write it: Commas in print add spaces; + glues with no space. Or use an f-string: f"The {noun} likes to {verb}".
print("The", noun, "loves to", verb + "!")
print(f"The {noun} loves to {verb}!")Think about it
Look at this code. What happens next, and why? Say it in your own words.
print(f"The {colour} {animal} danced!")Watch & explore βΆ
Power-up: How Mad Libs works
See it happen
1 / 3animal = input("An animal? ")Ask for a word. A noun names something, like a dragon.
3) Run the code & terminal output
Press βΆ RUN and your program's messages appear here!


Captain Py
Our next adventure is yours to create.
