loop
← All sections

Module 4 · Functions, tuples, dictionaries, exceptions, and data processing

Function return

If parameters are how data goes in, return is how it comes back out. Learn the difference between a function's effect and its result, meet the None value, see how lists travel in and out — then build five real functions.

Begin lesson 1 →
  1. 1Effects and results: returnHand a value back out of a function with return — and capture it on the way out.
  2. 2The None valueWhat a function gives back when it has no return: Python's nothing, None.
  3. 3Lists and functionsReturn a whole list — or pass one in and let the function change it in place.
  4. 4ExamplesFive real functions: leap year, days in a month, day of the year, primes, fuel conversion.