Courseiva

200-901 Software Development and Design Practice Question

Given the Python list comprehension: result = [x*2 for x in range(10) if x > 5] What is the value of result?

⚠ Common exam trap

The trap here is that candidates often forget the filter condition and include all values, or they mistakenly apply the multiplication to the filtered indices rather than the values, leading to options like C or D.

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

✓

[12, 14, 16, 18]

The list comprehension `[x*2 for x in range(10) if x > 5]` iterates over `x` from 0 to 9, filters to only include `x` values greater than 5 (i.e., 6, 7, 8, 9), and multiplies each by 2, producing `[12, 14, 16, 18]`. This is a standard Python comprehension with a conditional filter.

Answer analysis

Option-by-option breakdown

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

  • ✓

    [12, 14, 16, 18]

    Why this is correct

    The filter x > 5 restricts iteration to 6, 7, 8 and 9, since range(10) stops before 10. Doubling each yields 12, 14, 16 and 18, so the comprehension produces exactly that four-element list in ascending order.

  • ✗

    [0, 2, 4, 6, 8, 10, 12, 14, 16, 18]

    Why it's wrong here

    The filter x > 5 excludes 0 through 5, so doubling every element of range(10) is wrong. It is tempting because it applies the x*2 transform correctly, and it would be correct had the comprehension omitted the if condition entirely.

  • ✗

    [10, 12, 14, 16, 18]

    Why it's wrong here

    The comprehension doubles each value after filtering, so 6 becomes 12, not 10. It is tempting because it correctly selects 6 through 9, and it would be correct if the expression were x + 4 rather than x*2.

  • ✗

    [6, 7, 8, 9]

    Why it's wrong here

    This returns the filtered values themselves without applying the x*2 transform. It is tempting because the filter x > 5 is applied correctly, and it would be correct if the comprehension were [x for x in range(10) if x > 5].

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 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.