Bird
0
0

Which of the following is the correct way to use continue inside a while loop in Python?

easy📝 Syntax Q3 of 15
Python - Loop Control
Which of the following is the correct way to use continue inside a while loop in Python?
Awhile condition: if some_check: continue do_something()
Bwhile condition: continue if some_check do_something()
Cwhile condition: if some_check: break continue
Dwhile condition: do_something() continue if some_check
Step-by-Step Solution
Solution:
  1. Step 1: Syntax of continue

    In Python, continue is a standalone statement used inside loops.
  2. Step 2: Correct usage in while loop

    while condition: if some_check: continue do_something() correctly places continue inside an if block without extra syntax.
  3. Final Answer:

    while condition: if some_check: continue do_something() is the correct syntax.
  4. Quick Check:

    Is continue used as a statement? Yes in A. [OK]
Quick Trick: Continue is a standalone statement inside loops [OK]
Common Mistakes:
MISTAKES
  • Using continue as an expression
  • Placing continue outside loop body
  • Confusing continue with break

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Python Quizzes