Unpacking iterables into function arguments PREMIUM

Series: Functions
Trey Hunner smiling in a t-shirt against a yellow wall
Trey Hunner
2 min. read Watch as video Python 3.8—3.12
Python Morsels
Watch as video
01:49

In Python, you can unpack the items in an iterable into separate positional arguments in a function, even if you don't know how long the iterable is.

Unpacking iterables of known length into function arguments

Here we have a list called things and we want to print out each item in that list:

...

A Python Tip Every Week

Need to fill-in gaps in your Python skills? I send weekly emails designed to do just that.

Python Morsels
Watch as video
01:49