logo

Question detail

How many times is the body of this Python 3 loop executed? for count in range(4): print(count)

Try the question, check the answer, then read the explanation to understand the curriculum point.

At a glance

MCQ

Type

practice

Style

Topic

Programming

Exam-style question

Try this first

How many times is the body of this Python 3 loop executed? for count in range(4): print(count).

  1. A.3
  2. B.4
  3. C.5
  4. D.It depends on the value of count before the loop

Model answer

What a good answer should say

  • 4

Explanation

Why this works

The range produces 0, 1, 2 and 3, so the loop body executes four times. This is definite iteration because the number of repetitions is determined by the range.

Common mistake

No common mistake is linked to this question yet.

Related flashcards

No flashcards are published for this page yet.

Related practice questions

No questions are published for this page yet.