# File: loop1.py # Program to show break and continue statements # this prints 1 2 4 5 on separate lines # # Matt Bishop, MHI 289I, Fall 2024 # # initialize counter i = 0; # infinite loop; we drop out using a break statement while True: # next number i += 1 # if it's 3, do not print it; just go on to the next number if i == 3: continue # print it print(i) # if it's 5, exit loop; otherwise, go up to next number if i == 5: break