
If I am using the following condition in my program:
Which keyword should I use to make sure I don’t create an infinite loop?
Answer Options:
- break
- continue

If I am using the following condition in my program:
Which keyword should I use to make sure I don’t create an infinite loop?
Answer Options:
Correct Answer:
Explanation: The break keyword is used to exit a loop immediately, which is necessary to prevent an infinite loop in a while True: statement. The continue keyword skips the rest of the current iteration and goes to the next iteration of the loop, which does not terminate the loop.