Consider the loop given below. How many times will this loop run?
for I in range(10, 5, -3)
print(i)
Answers
Answered by
10
Answer:-
Given code,
for I in range(10, 5, -3):
print(i)
After first execution, (i=10)
Output:- 10
i=7
After second execution,
Output:- 7
i=4
Now, i is less than 6. So, loop terminates.
So, number of times the loop executes is 2.
Similar questions