CBSE Class 12 Computer Science
Question 92 of 105
Python Revision Tour — Question 18
Back to all questionsLoop executes for 5 times.
*
*
*
*
*
range(1,3,1) returns [1, 2]. For first iteration of outer loop j is in range [0, 1] so inner loop executes twice. For second iteration of outer loop j is in range [0, 1, 2] so inner loop executes 3 times. This makes the total number of loop executions as 2 + 3 = 5.