answersLogoWhite

0


Best Answer

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

6y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the keyword for function(python)?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Is check a keyword in java?

No, 'check' is not a keyword in java language.


What is the use of keyword new used in AWT programming?

what is the use of new keyword in awt programming


Is super keyword is analogous to this keyword in java?

No. The keyword super is used to refer to the parent class instance while the keyword this is used to refer to the current class instance. You need to learn about Inheritance and Object creation using constructors to learn more about these keywords and their use


What is fuzzy keyword?

yes


What is a keyword to division?

per

Related questions

What is library keyword?

What is library keyword?


What is the keyword for ruby redfort catch your death?

The keyword is Marie Antoinette


How do you find the keyword of a specific book?

give me a keyword


How can you check keyword density?

There are many online tools are available for checking keyword density. I have mention some tools which are given below:- seobook.com/general/keyword-density/ smallseotools.com googletheplanet.com seoquake.com/ You can check keyword density by using these tools. I had checked my site (Royzez) keyword from seoquake and smallseotools.


Is check a keyword in java?

No, 'check' is not a keyword in java language.


Where can one get more details about the keyword?

"This is dependent on what keyword you are looking for. If you are looking for a keyword in a document you can type ctrl f to search for a keyword, or if it is for a secret club, you might need to join to find out."


What is the keyword that sums up to Skills and Experience?

Skills and Experience Keyword


Is in is used as a keyword in C language?

Neither "in" nor "is" is a keyword in C.


What is java's keyword for the integer data type?

"int" is the keyword for integer


Is float is a keyword in java?

yes, float is keyword and data type in java


What command is equivalent to the man -k keyword command?

apropos keyword


What is argument in actionscript?

In ActionScript, an argument refers to a value that is passed to a function when it is called. These arguments can be used within the function to perform operations or calculations. Functions can accept multiple arguments, which allows for flexibility and customization in how they are used.