PYTHON CORE · LESSON 25
Stop the loop
Command break · about 12 minutes
Learning with progressRead the summary for free. To save the work, log in to the account.
Type the code yourself
Dial the stop loop. Watch the two levels of indentation.
for n in range(5):
if n == 3:
break
print(n)Open the editor for class workSolve it yourself
for loop with n and range(6) output numbers, but stop using break when n becomes 4. Lines 0-3 should appear.
The answer is hidden. Use similar examples from the lesson notes.
Opening up your homework