200-901 Software Development and Design Practice Question
In Python, which of the following is a valid way to define a function that accepts a variable number of positional arguments?
⚠ Common exam trap
Cisco often tests the distinction between `*args` (positional) and `**kwargs` (keyword) and may include syntactically invalid options like `args*` to catch candidates who misremember the asterisk placement.
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 func(*args):
In Python, the `*args` syntax in a function definition allows the function to accept a variable number of positional arguments. The asterisk (`*`) collects all extra positional arguments into a tuple named `args`, enabling flexible argument handling.
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 func(args):
Why it's wrong here
This expects a single argument; no variable number.
- ✗
def func(args*):
Why it's wrong here
Invalid syntax; the asterisk must precede the parameter name.
- ✗
def func(**kwargs):
Why it's wrong here
**kwargs collects keyword arguments, not positional.
- ✓
def func(*args):
Why this is correct
Yes, *args collects extra positional arguments.
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.