Courseiva

200-901 Software Development and Design Practice Question

A developer is writing a Python function that accepts a variable number of interface names and returns them as a tuple. Which function definition correctly allows an arbitrary number of positional arguments?

⚠ Common exam trap

Candidates often confuse *args with **kwargs, where the single asterisk collects positional arguments into a tuple and the double asterisk collects keyword arguments into a dictionary.

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 list_interfaces(*interfaces):

The function must accept a variable number of positional arguments. Using *interfaces packs all positional arguments into a tuple, which is exactly what the scenario requires. The other definitions either accept a single argument, collect keyword arguments into a dictionary, or use a mutable default that introduces bugs and still does not support multiple positional 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 list_interfaces(*interfaces):

    Why this is correct

    The asterisk before the parameter name collects all positional arguments into a tuple named interfaces. This allows the function to accept any number of interface names, including zero, and directly returns them as a tuple when referenced. This matches the scenario's requirement for arbitrary positional arguments.

  • ✗

    def list_interfaces(interfaces):

    Why it's wrong here

    This definition accepts exactly one positional argument named interfaces. If the caller passes multiple interface names, Python raises a TypeError. In the scenario, the function must handle an arbitrary number of interface names, so a single fixed parameter does not satisfy the requirement.

  • ✗

    def list_interfaces(**interfaces):

    Why it's wrong here

    Double asterisks collect keyword arguments into a dictionary, not positional arguments into a tuple. If the developer calls the function with positional interface names, Python raises a TypeError. This syntax is meant for named parameters, so it does not fulfill the requirement of accepting an arbitrary number of positional interface names.

  • ✗

    def list_interfaces(interfaces=[]):

    Why it's wrong here

    This defines a single parameter with a mutable default value, which is a well-known Python anti-pattern. It does not allow multiple positional arguments; passing more than one still raises a TypeError. Additionally, using a mutable default can cause unexpected shared state across calls, making it unsuitable for the scenario.

About these practice questions

This 200-901 question is part of Courseiva's 975-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 →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official Cisco exam blueprint

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.