How many times the for loop execute and what is the output ?
for i in range (1,3,1);
for j in range (i+1):
print ('*')
Answers
Answered by
0
Answer:
Working. 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.
Similar questions