Quizzma Latest Questions

If I am using the following condition in my program

Anonymous

If I am using the following condition in my program:

while True:

Which keyword should I use to make sure I don’t create an infinite loop?

Answer Options:

  • break
  • continue



Leave an answer

Leave an answer

1 Answer

  1. Correct Answer:

    • break

    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.

Related Questions