Tutorial by Topics: args

A “varargs” method argument allows callers of that method to specify multiple arguments of the designated type, each as a separate argument. It is specified in the method declaration by three ASCII periods (...) after the base type. The method itself receives those arguments as a single array, w...
There a few things to note: The names args and kwargs are used by convention, they are not a part of the language specification. Thus, these are equivalent: def func(*args, **kwargs): print(args) print(kwargs) def func(*a, **b): print(a) print(b) You may...

Page 1 of 1