Courseiva

200-901 Software Development and Design Practice Question

A Python function is defined as:

def process(*args, **kwargs):
    return sum(args) + kwargs.get('offset', 0)

What is the result of process(1, 2, 3, offset=10)?

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

✓

16

*args captures positional arguments as tuple (1,2,3), sum is 6, kwargs dict includes {'offset':10}, .get returns 10, total 16.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    6

    Why it's wrong here

    The positional arguments 1, 2 and 3 are captured by *args, so sum(args) equals 6. The keyword argument offset=10 is captured by **kwargs, and kwargs.get('offset', 0) returns 10. The function therefore returns 6 + 10 = 16, not 6.

  • ✓

    16

    Why this is correct

    The `*args` parameter collects the positional arguments 1, 2 and 3 into a tuple, which `sum()` totals to 6. The `**kwargs` parameter collects `offset=10` into a dictionary, and `kwargs.get('offset', 0)` retrieves 10. Adding 6 and 10 returns 16.

  • ✗

    Error

    Why it's wrong here

    No error occurs: *args collects the positional values 1, 2 and 3, while **kwargs collects offset=10 as a dictionary entry. sum(args) yields 6 and kwargs.get('offset', 0) yields 10, so the call returns 16. An error would require a missing required parameter or a type mismatch.

  • ✗

    10

    Why it's wrong here

    The function sums positional arguments (1+2+3=6) then adds the offset keyword value of 10, giving 16, not 10. Returning 10 would require args to sum to zero, or offset to be ignored entirely. The kwargs.get pattern is designed precisely to fold named options into the total, so the offset must be counted.

About these practice questions

Courseiva writes every 200-901 question from scratch — 975 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

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.