Skip to content

Latest commit

 

History

History
18 lines (13 loc) · 414 Bytes

File metadata and controls

18 lines (13 loc) · 414 Bytes

Unpacking

Extracting values from iterables directly into variables or function arguments.

Covered

  • Unpacking a list into function arguments with *
  • Unpacking a tuple into variables
  • Unpacking a function's return value
  • Star operator *rest to capture remaining elements
  • Unpacking with zip
  • zip_longest from itertools for iterables of unequal length

Run

python unpacking.py