Net-informations.com
SiteMap  | About    

What do *args and **kwargs mean?

The parameter with ** (double star) and * (star) allow for functions to be defined to accept and for users to pass any number of arguments , positional (*) and keyword (**). The single asterisk form (*args) is used to pass a non-keyworded, when we aren't sure how many arguments are going to be passed to a function, or if we want to pass a stored list or tuple of arguments to a function. The double asterisk (**kwargs) form is used to pass keywors, when we don't know how many keyword arguments will be passed to a function, which will be in a dict named kwargs.

*args example

output

**kwargs example

output









net-informations.com (C) 2017    Founded by raps mk
All Rights Reserved. All other trademarks are property of their respective owners.