KnowledgeBoat Logo
|

Robotics & Artificial Intelligence

A loop statement is given as:

for i in range(10):

For how many times will the given loop statement be executed?

  1. none
  2. 9 times
  3. 10 times
  4. infinite

Python Control Flow

2 Likes

Answer

10 times

Reason — The function range(10) generates a sequence of numbers from 0 to 9, which contains 10 values. Hence, the loop will execute 10 times.

Answered By

1 Like


Related Questions