Search the courses, subjects, tracks, games and features, or jump straight to a page.
3 cards from this section. Quick, good the night before a test.
What does *args allow in a Python function?
Think about how many numbers you can add to a function.
What type of data structure does **kwargs use?
Consider how you can access values by keys.
What does the * in *args signify?
Think about what happens to extra inputs in a function.
True or False: **kwargs must always include at least one argument.
Remind yourself of the flexibility provided by kwargs.
Design a function that accepts an unknown number of scores, calculates the average, and allows for an optional keyword argument to specify whether to round the result.
Think about how you can control the output format with a keyword argument.
Write a function with both *args and **kwargs that returns a formatted string detailing provided items and attributes.
Make use of both collected positional and keyword arguments to build your output.
6 more questions in this section. Enroll free to practise them all.
Enroll free