Search the courses, subjects, tracks, games and features, or jump straight to a page.
2 cards from this section. Quick, good the night before a test.
What does the break statement do in a loop?
Think about how to exit a loop early.
What does the continue statement do?
Consider what happens in a loop when a condition is met.
What effect does the break statement have in a loop?
Remember how it modifies the loop execution.
True or False: The continue statement stops the loop entirely.
Think about what happens after continue.
Write a program that uses a break statement to stop the loop when a user inputs a specific word. What modifications would be necessary to also apply a continue statement?
Think about conditions that trigger stop and continue.
Create a function that accepts a list of numbers and utilizes break and continue to print only odd numbers while stopping when hitting a maximum threshold, say 10.
Consider the conditions set for break and continue carefully.
5 more questions in this section. Enroll free to practise them all.
Enroll free