Bird
0
0

Find the error in this code:

medium📝 Debug Q14 of 15
Python - Conditional Statements
Find the error in this code:
number = 10
if number > 5
    print('Big number')
AIndentation error in print statement
BMissing colon ':' after the if condition
CWrong comparison operator
DVariable 'number' is not defined
Step-by-Step Solution
Solution:
  1. Step 1: Check the if statement syntax

    Python requires a colon ':' at the end of the if condition line.
  2. Step 2: Identify the missing colon

    The code misses ':' after if number > 5, causing a syntax error.
  3. Final Answer:

    Missing colon ':' after the if condition -> Option B
  4. Quick Check:

    Colon missing after if condition [OK]
Quick Trick: Always put ':' after if condition [OK]
Common Mistakes:
MISTAKES
  • Forgetting colon after if
  • Misaligning indentation
  • Changing comparison operator unnecessarily

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Python Quizzes