Bird
0
0

Find the error in this code snippet:

medium📝 Debug Q14 of 15
Python - Input and Output
Find the error in this code snippet:
age = 25
print(f"Age is {age")
AMissing closing brace '}' in f-string
BMissing f before the string
CVariable age is not defined
DIncorrect use of quotes
Step-by-Step Solution
Solution:
  1. Step 1: Check f-string braces

    The f-string has an opening brace { but no matching closing brace }, causing a syntax error.
  2. Step 2: Verify other parts

    The f prefix is present, variable age is defined, and quotes are correct.
  3. Final Answer:

    Missing closing brace '}' in f-string -> Option A
  4. Quick Check:

    Every { must have a matching } in f-string [OK]
Quick Trick: Count braces in f-string; each { needs a } [OK]
Common Mistakes:
MISTAKES
  • Forgetting to close curly braces
  • Thinking missing f causes this error
  • Assuming variable is undefined

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Python Quizzes