Quiz: Build Your Own Commands
Explore how to define and use custom Python functions by taking a quiz that reinforces your ability to build reusable blocks of code with inputs and outputs. This lesson helps you practice writing modular programs and prepares you for creating interactive projects like a Mad Lib generator.
We'll cover the following...
In the last lesson, you learned how to create your functions, reusable blocks of code you can name, customize with inputs (parameters), and use as many times as you like. You explored how to define functions with def, how to pass arguments, and even how to return values.
Let’s see what you’ve learned with a quick quiz!
What does the def keyword do in Python?
Deletes a variable.
Defines a new function.
Displays the text.
Awesome! You now know how to write your functions, making your code more modular, flexible, and fun to work with.
What’s next?
Time to get creative! In the next hands-on project, you’ll build your own Mad Lib generator. You’ll write a function that takes three words—a noun, a verb, and an adjective—and uses them to print a silly, custom sentence.
You’ll combine everything you’ve just learned: defining functions, using inputs, and crafting a unique message. Let’s make Python tell some goofy stories!