answersLogoWhite

0

There are two related concepts, both called "keyword arguments". On the calling side, which is what other commenters have mentioned, you have the ability to specify some function arguments by name. You have to mention them after all of the arguments without names (positional arguments), and there must be default values for any parameters which were not mentioned at all. The other concept is on the function definition side: You can define a function that takes parameters by name -- and you don't even have to specify what those names are. These are pure keyword arguments, and can't be passed positionally. The syntax is def my_function(arg1, arg2, **kwargs) Any keyword arguments you pass into this function will be placed into a dictionary named kwargs. You can examine the keys of this dictionary at run-time, like this: def my_function(**kwargs): print str(kwargs) my_function(a=12, b="abc") {'a': 12, 'b': 'abc'}

User Avatar

Wiki User

7y ago

What else can I help you with?

Related Questions

What is the keyword for this question?

The keyword for this question is "keyword."


Is it true that the keyword is included in the question?

Yes, the keyword "keyword" is included in the question.


What is library keyword?

What is library keyword?


What is the regular expression for a context-free grammar that generates the keyword "keyword"?

The regular expression for a context-free grammar that generates the keyword "keyword" is simply the word "keyword" itself.


What is the difference between a keyword indicator and a keyword metric?

A keyword indicator is a qualitative measure that shows the relevance or importance of a keyword, while a keyword metric is a quantitative measure that provides specific data or statistics related to a keyword's performance or impact.


Is the keyword "definite" or "indefinite"?

The keyword is "definite."


What is the keyword for ruby redfort catch your death?

The keyword is Marie Antoinette


What is the lexicographically smallest palindrome that can be formed using the letters in the keyword "keyword"?

The lexicographically smallest palindrome that can be formed using the letters in the keyword "keyword" is "deed."


What is the result of using the time operator on the keyword "keyword"?

The result of using the time operator on the keyword "keyword" is the current time in milliseconds when the operation was executed.


What is the filling date for the keyword?

The filling date for the keyword is the date on which the keyword was officially submitted for consideration or registration.


How do you find the keyword of a specific book?

give me a keyword


Is the keyword an accomplice in the crime"?

No, a keyword is not an accomplice in a crime.