Bird
0
0

Find the error in this code:

medium📝 Debug Q6 of 15
Python - Conditional Statements
Find the error in this code:
if x = 10:
    print('Ten')
AMissing colon after if
Bprint statement syntax wrong
CIndentation error
DUsing = instead of == in condition
Step-by-Step Solution
Solution:
  1. Step 1: Check the condition syntax

    The code uses single = which is assignment, not comparison.
  2. Step 2: Identify correct comparison operator

    For condition, == is needed to compare values.
  3. Final Answer:

    Using = instead of == in condition -> Option D
  4. Quick Check:

    Use '==' for comparison in if condition [OK]
Quick Trick: Use '==' to compare, '=' assigns value [OK]
Common Mistakes:
MISTAKES
  • Using = instead of ==
  • Forgetting colon after if
  • Wrong indentation

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Python Quizzes