Search the courses, subjects, tracks, games and features, or jump straight to a page.
5 cards from this section. Quick, good the night before a test.
Define a function that prints a welcome message. Demonstrate positional arguments with it.
Think about how the position of the argument matters.
What happens if you reverse the order of arguments in student(name, age)?
Remember, positional arguments rely on order.
What does a positional argument depend on?
Remember the saying 'Location is Key'.
True or False: student(age=17, name='Alice') uses positional arguments.
Think about how the arguments are defined.
Create a function that takes arbitrary keyword arguments and formats them into a readable string.
How would you combine keys and values into a single output?
Write a Python function that incorporates both *args and **kwargs, printing each part.
Think about how each part works with a different kind of input.
6 more questions in this section. Enroll free to practise them all.
Enroll free