PYTHON INTERMEDIATEChapter 6 · Comprehensions and data tools
Flexible arguments
Put * before a parameter and it collects any extra positional arguments into a tuple. Put ** before one and it collects extra keyword arguments into a dict. The names args and kwargs are just a convention. The stars work the other way when calling: total(*values) spreads a list into separate arguments.
Worked example
How it reads
*numbersis a tuple of every positional argument, even none**detailsis a dict of everyname=valueargumenttotal(*scores)unpacks the list into three separate arguments

Cloud tip: Order matters in a definition: normal parameters, then
*args, then keyword-only ones, then **kwargs.

