for i in range(5): # For loop if i == 3: break # Exits out of the for loop, even when not finished else: print(i) number = 1 while number <= 5: if number == 4: break # Exits while loop else: print(number)