Search the courses, subjects, tracks, games and features, or jump straight to a page.
2 cards from this section. Quick, good the night before a test.
What is a keyword argument?
Think about how you would call a function and specify parameters by name.
Can you provide an example of calling a function with keyword arguments?
Your example should show both parameter names and values.
What is the primary advantage of using keyword arguments in a function?
Think about what happens when you have many parameters.
True or False: With keyword arguments, the order in which arguments are passed does not matter.
Consider how you might call a function.
Create a function named config that accepts three parameters: mode, height, and width. Set default values for height and width. Call this function using different combinations of arguments to demonstrate keyword flexibility.
Consider how defaults apply when you are not passing all parameters.
Design a function create_profile that takes parameters username, email, and age. Make age a keyword argument with a default value of 18. Walk through calling this function with various inputs.
Think about using default and optional parameter combinations.
6 more questions in this section. Enroll free to practise them all.
Enroll free