Courseiva
Question 136 of 498
Control Flow, Loops, Lists and LogiceasyMultiple ChoiceObjective-mapped

PCEP Control Flow, Loops, Lists and Logic Practice Question

Exhibit

count = 0
while count < 5:
    count += 1
    if count == 3:
        continue
    print(count, end=' ')

What is the output of the following code?

for i in range(1, 6):
    if i == 3:

continue

print(i, end=' ')

⚠ Common exam trap

Python Institute often tests the `continue` statement by making candidates forget that it only skips the current iteration, not the entire loop, leading them to incorrectly omit subsequent values or include the skipped value.

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

1 2 4 5

The code uses a for loop with range(1, 6) and a continue statement when i == 3. When i equals 3, the continue skips the print(i, end=' ') statement, so 3 is not printed. The loop iterates through 1, 2, 4, and 5, producing the output '1 2 4 5'.

Answer analysis

Option-by-option breakdown

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

  • 1 2 3 4 5

    Why it's wrong here

    Does not skip 3.

  • 1 2 4 5

    Why this is correct

    Correct; print is skipped for 3.

  • 1 2 4

    Why it's wrong here

    Misses 5.

  • 1 2 3 4

    Why it's wrong here

    Includes 3 and misses 5.

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Last reviewed: Jun 30, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

This PCEP practice question is part of Courseiva's free Python Institute 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 PCEP exam.