Brainlag
  1. Library
  2. Concepts
  3. Python

Functions and return values

A function is a named block you can run with different inputs. Parameters carry values in, return carries one value back out.

Python10 minPremium

Premium

Inside: an interactive visualisation, 2 short explanations, a runnable example and 1 checked exercise.

See Premium£7.99 a month. Already Premium? Sign in

Code editor. Press Control or Command plus Enter to run the code. Tab indents; to move focus out of the editor, press Escape and then Tab.