A loop adds up numbers. It skips the even ones with continue, and it ends early with break once a number is too big.
total = 0
for n in range(1, 8):
if n % 2 == 0:
continue
if n > 5:
break
total += n
print(total, n)
What does the program print?
Log in to join the discussion.
Loading…