Solution: Mad Lib Generator
This program defines a function that creates a fun sentence using the words you give it.
def madlib(noun, verb, adjective):defines a function namedmadlibthat takes three inputs (called parameters): a noun, a verb, and an adjective.Inside the function, the
print()statement combines these words to make a sentence.When you call the function with
madlib("cat", "dance", "silly"), the words fill in those spots:noun→"cat"verb→"dance"adjective→"silly"
Solution: Mad Lib Generator
This program defines a function that creates a fun sentence using the words you give it.
def madlib(noun, verb, adjective):defines a function namedmadlibthat takes three inputs (called parameters): a noun, a verb, and an adjective.Inside the function, the
print()statement combines these words to make a sentence.When you call the function with
madlib("cat", "dance", "silly"), the words fill in those spots:noun→"cat"verb→"dance"adjective→"silly"