MemotivaFunctions and arguments

What is unpacking in function calls?

Functions and arguments

Audio flashcard · 0:16

Nortren·

What is unpacking in function calls?

0:16

Unpacking lets you pass an iterable as positional arguments using a single star, or a dictionary as keyword arguments using double star. For example, calling f with star my list passes the elements of my list as separate positional arguments. This is the inverse of args and kwargs collection in definitions.
docs.python.org