Python Functions · Week 1 — Your First Function
Define and call functions; indentation; one-line bodies.
Week 1: Your First Function
Welcome to Week 1 of Python Functions! In this unit, we'll learn how to write our own mini-programs using functions. Functions are like recipes — they give a name to a set of instructions that we can use again and again. This week, we'll focus on the basics: defining a function and calling it. We'll use examples from our classroom friends, like Paul, Emma, and Leo.
Learning goals
- Understand the purpose of functions in Python.
- Use the def keyword to create a function.
- Call a function using its name followed by parentheses.
- Recognize the importance of indentation and the colon.
Preview truncated — download the notebook to see the full lesson.