Courseiva

200-901 Software Development and Design Practice Question

A developer is reviewing a colleague's pull request that adds a function to a shared Python utility module. The function must return the value of a REST API response, but the reviewer notices the function currently prints the parsed response instead of returning it. Which change makes the function usable by callers that need to process the data further?

⚠ Common exam trap

The trap here is believing that visible console output means the function produced a usable value, when output and return values are independent.

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

✓

Replace the print() call with a return statement that yields the parsed response object to the caller.

Functions that produce data for other code should return that data rather than emit it as a side effect. Printing, flushing, logging, or stashing values in globals all leave the function evaluating to None, so callers cannot chain or transform the result. Returning the parsed response object is what makes the function composable.

Answer analysis

Option-by-option breakdown

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

  • ✓

    Replace the print() call with a return statement that yields the parsed response object to the caller.

    Why this is correct

    A return statement hands the parsed object back to the calling code, which can then store, transform, or assert on it. Printing only writes to standard output and leaves the caller with None, so callers cannot process the data further, which is exactly what the scenario requires.

  • ✗

    Keep the print() call and wrap the response in a global variable that other modules import directly.

    Why it's wrong here

    Relying on a module-level global creates hidden state and import-order coupling, and the function still returns None. Callers would have to import the global instead of the function, which is fragile and does not make the function itself usable as described.

  • ✗

    Keep the print() call and add sys.stdout.flush() after it so downstream code can read the data.

    Why it's wrong here

    Flushing standard output only ensures buffered text reaches the console; it does not deliver any value to the caller. The function still evaluates to None, so code that assigns the result would receive nothing usable and could not process the response.

  • ✗

    Change print() to logging.info() so the response is captured by the logging framework and returned automatically.

    Why it's wrong here

    Logging records messages for operators and does not change the function's return value; it still yields None. Callers cannot programmatically consume log records as a return value, so this change does not let them process the response data.

About these practice questions

One of 975 original 200-901 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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.