After the break statement in (a) is executed in the following loop, which statement is executed? Show the output. After the continue statement in (b) is executed in the following loop, which statement is executed? Show the output.
(a)
for i in range(1, 4):
for j in range(1, 4):
if i * j > 2:
break
print(i * j)
print(i)
(b)
for i in range(1, 4):
for j in range(1, 4):
if i * j > 2:
continue
print(i * j)
print(i)
Sorry the answer is not available at the moment…
If you are able to find the answer, please make sure to post it here. So that your Juniors have smile on their lips and feel happy.
Spread the 'tradition of sharing'.