5. If the search fails, it reports the last tuple it saw.
pairs = [(1, "a"), (2, "b"), (3, "c")]
for n, ch in pairs:
if n * 2 == 5:
print("found", ch)
break
else:
print("none", n, ch)
What does the program print?Log in to join the discussion.
Loading…