Functions
Level 1 · estimatedGive a block of lines a name, pass it values and get a result back. Trace what each name holds inside and outside the function, and predict each result before you run the program.
Lessons
Read the whole unit on one page
- Give a repeated task a nameLevel 1 · Foundations
- Pass an argumentLevel 1 · Foundations
- Return a resultLevel 1 · Foundations
- Trace a local nameLevel 1 · Foundations
- Compose two small functionsLevel 1 · Foundations
Sources
- Python 3.13 Tutorial, 4.8 Defining Functions. Python Software Foundation. Python Software Foundation License Version 2. Read 1 Dec 2026. Cited in Give a repeated task a name, Return a result, Trace a local name, Compose two small functions.
- Python 3.13 Language Reference, 8.7 Function definitions. Python Software Foundation. Python Software Foundation License Version 2. Read 1 Dec 2026. Cited in Give a repeated task a name.
- Python 3.13 Language Reference, 6.3.4 Calls. Python Software Foundation. Python Software Foundation License Version 2. Read 1 Dec 2026. Cited in Give a repeated task a name, Pass an argument, Return a result, Compose two small functions.
- Python 3.13 Library Reference, Built-in Exceptions: NameError. Python Software Foundation. Python Software Foundation License Version 2. Read 1 Dec 2026. Cited in Give a repeated task a name.
- Python 3.13 Tutorial, 4.10 Intermezzo: Coding Style. Python Software Foundation. Python Software Foundation License Version 2. Read 1 Dec 2026. Cited in Give a repeated task a name.
- Python 3.13 Language Reference, 7.1 Expression statements. Python Software Foundation. Python Software Foundation License Version 2. Read 1 Dec 2026. Cited in Give a repeated task a name, Return a result.
- Python 3.13 Glossary: parameter. Python Software Foundation. Python Software Foundation License Version 2. Read 1 Dec 2026. Cited in Pass an argument.
- Python 3.13 Glossary: argument. Python Software Foundation. Python Software Foundation License Version 2. Read 1 Dec 2026. Cited in Pass an argument.
- Python 3.13 Tutorial, 3.1.2 Text. Python Software Foundation. Python Software Foundation License Version 2. Read 1 Dec 2026. Cited in Pass an argument.
- Python 3.13 Language Reference, 7.6 The return statement. Python Software Foundation. Python Software Foundation License Version 2. Read 1 Dec 2026. Cited in Return a result, Compose two small functions.
- Python 3.13 Language Reference, 8.1 The if statement. Python Software Foundation. Python Software Foundation License Version 2. Read 1 Dec 2026. Cited in Return a result, Compose two small functions.
- Python 3.13 Library Reference, Built-in Exceptions: TypeError. Python Software Foundation. Python Software Foundation License Version 2. Read 1 Dec 2026. Cited in Return a result, Compose two small functions.
- Python 3.13 Language Reference, 4.2 Naming and binding. Python Software Foundation. Python Software Foundation License Version 2. Read 1 Dec 2026. Cited in Trace a local name.
- Python 3.13 Language Reference, 6.10.1 Value comparisons. Python Software Foundation. Python Software Foundation License Version 2. Read 1 Dec 2026. Cited in Compose two small functions.