loop
← All sections

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

How functions communicate with their environment

Functions get useful when you can feed them data. Meet parameters and arguments — the slots a function declares and the values you pass in — and the two ways to pass them: by position and by name.

Begin lesson 1 →
  1. 1Parameterized functionsGive a function inputs: parameters are the named slots, arguments are the values you pass in.
  2. 2Positional parameter passingArguments fill parameters by their position — first to first, second to second.
  3. 3Keyword argument passingName each argument at the call, and the order stops mattering.
  4. 4Mixing positional and keywordUse both at once — with the one rule that keeps Python happy.
  5. 5QuizCheck your grip on parameters, positional order, and keyword arguments.