MemotivaFunctions and arguments

What are star args and double star kwargs?

Functions and arguments

Audio flashcard · 0:14

Nortren·

What are star args and double star kwargs?

0:14

Star args collects extra positional arguments into a tuple. Double star kwargs collects extra keyword arguments into a dictionary. They allow functions to accept a variable number of arguments. The names args and kwargs are conventional but any name works.
docs.python.org