Python · Lesson 7.1 · Pro

Defining functions

Wrap a piece of logic in a named function you can call again and again.

In this lesson

  1. def makes a function
  2. return, not print
  3. Functions can use if and loops
  4. Call functions from functions