Two loops, one inside the other. The break is in the inner loop, and a counter is increased before it.
pairs = 0
for a in range(1, 5):
for b in range(a, 5):
if (a + b) % 4 == 0:
break
pairs += 1
print(pairs)
What is printed on the screen?
Log in to join the discussion.
Loading…