Hi! Can somebody please explain why line 6 makes our code run differently?

smallest = None
print("Before:", smallest)
for itervar in [3, 41, 12, 9, 74, 15]:
    if smallest is None or itervar < smallest:
        smallest = itervar
    print("Loop:", itervar, smallest)
print("Smallest:", smallest)

because this lline tells “quit the loop immediately”

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.