200-901 Software Development and Design Practice Question
A developer needs to create a Python function that accepts any number of keyword arguments and prints them. Which function definition correctly uses **kwargs?
⚠ Common exam trap
Cisco often tests the distinction between *args (positional arguments) and **kwargs (keyword arguments), and the trap here is that candidates confuse the single asterisk (*) for collecting keyword arguments instead of the double asterisk (**).
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
def print_args(**kwargs): print(kwargs)
The **kwargs syntax in a Python function definition collects any number of keyword arguments into a dictionary. The function then prints that dictionary, which matches the requirement to accept and print any number of keyword arguments.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
def print_args(*args): print(args)
Why it's wrong here
*args is for positional arguments, not keyword arguments.
- ✗
def print_args(kwargs): print(kwargs)
Why it's wrong here
This expects a single argument, not arbitrary keyword arguments.
- ✓
def print_args(**kwargs): print(kwargs)
Why this is correct
**kwargs collects keyword arguments into a dict.
- ✗
def print_args(*kwargs): print(kwargs)
Why it's wrong here
Syntax error; *kwargs is not valid.
Go deeper
Related to this question
About these practice questions
This 200-901 question is part of Courseiva's 989-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This 200-901 practice question is part of Courseiva's free Cisco certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the 200-901 exam.