Functions
Lesson 17 of 20 · Py.Micro
Package code under a name, give it inputs and get a result back.
def area(w, h): defines a function; area(3, 4) calls it with w=3, h=4, and return sends the result back. The step by step shows the call frame.
Check yourself
What does a function without return give back?
Do it in the browser: a real Python tool, a short mission and instant feedback. No install.
Start this lesson — free