Bird
0
0

Which of the following is the correct syntax to use continue inside a for loop?

easy📝 Syntax Q12 of 15
Python - Loop Control
Which of the following is the correct syntax to use continue inside a for loop?
Afor i in range(5) { continue }
Bfor i in range(5): continue
Cfor i in range(5) continue
Dfor i in range(5): continue
Step-by-Step Solution
Solution:
  1. Step 1: Check Python loop syntax

    Python requires a colon after the for statement and indentation for the loop body.
  2. Step 2: Identify correct placement of continue

    continue must be inside the loop body, properly indented on the next line.
  3. Final Answer:

    for i in range(5):\n continue -> Option D
  4. Quick Check:

    Colon + indent + continue line [OK]
Quick Trick: Use colon and indent for loop body with continue [OK]
Common Mistakes:
MISTAKES
  • Missing colon after for statement
  • Writing continue on same line without colon
  • Using braces {} which are not Python syntax

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Python Quizzes