58.6k views
4 votes
How many times does a loop with the header for count in range(10): execute the statements in its body?a. 9 timesb. 10 timesc. 11 times

User Hasnae
by
5.9k points

1 Answer

2 votes

Answer:

10 times

Step-by-step explanation:

Given

for count in range(10):

Required

Number of execution times

The given code snippet is in python

Python initializes its iteration to 0 and stops at the maximum range - 1

In this case, the loop starts at 0 and ends at 10 - 1 i.e. 9

So, the possible values of count variable are: 0,1,2,3,4,5,6,7,8,9

i.e 10 possible values

Hence, the loop will be executed 10 times

User Demo
by
5.4k points