Challenge: Mad Lib Generator
Discover how to write a Python function that generates a Mad Lib style sentence using user-provided words. Learn to define functions with parameters and produce dynamic output by combining nouns, verbs, and adjectives. This exercise helps you practice creating reusable code blocks that handle input and produce customized text output.
We'll cover the following...
We'll cover the following...
Let’s build a simple Mad Lib generator using a function.
Your task is to:
Create a function named
madlibThe function should accept three words:
a noun
a verb
an adjective
Inside the function, print a sentence that uses all three words.
For example, your program should be able to produce a sentence like:
“The silly cat decided to dance all day.”