Skip to main content
PProfileMatch
← Path

Python Fundamentals · Python Control Flow and Functions: if, for, while, def

0 XP
  1. 1 current stop: learning
  2. 2 upcoming
  3. 3 upcoming
  4. 4 upcoming
  5. 5 upcoming

Finish after stop 5

Stop 1 of 5 · Panniers: packing extra gear

Trick to keep in mind+3 XP

One star gathers a pile (tuple); two stars gather a labelled pile (dict)

In a def, *name sweeps up any extra positional arguments, and since they come in order they are packed into a tuple. **name sweeps up extra keyword arguments, which have names attached, so they are packed into a dict. Inside the function you then treat them as ordinary values.

Read it once, then a question tests whether the trick stuck.