+ 2

python help (def functaion(*test , **test))

what are *args and **kwargs ??? and how can i use them in this code ? def tmp(*args, **kwargs): return func(*args, **kwargs)

18th Sep 2017, 9:12 AM
hossein hayati
hossein hayati - avatar
1 Resposta
+ 2
*args and **kwargs are magic variables. *args is short for arguments **kwargs is short for keyword arguments They allow you to pass a variable amount of arguments to the function *args is used to pass non-keyworded variables to the function, while **kwargs is used to pass keyworded arguments to the function (id=1234) https://pythontips.com/2013/08/04/args-and-kwargs-in-JUMP_LINK__&&__python__&&__JUMP_LINK-explained/
18th Sep 2017, 9:46 AM
ChaoticDawg
ChaoticDawg - avatar