What does ** (double star/asterisk) and * (star/asterisk) do for parameters?
Share
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The
*args
and**kwargs
is a common idiom to allow arbitrary number of arguments to functions as described in the section more on defining functions in the Python documentation.The
*args
will give you all function parameters as a tuple:The
**kwargs
will give you all keyword arguments except for those corresponding to a formal parameter as a dictionary.