Bird
0
0

Find the error in this code:

medium📝 Debug Q6 of 15
Python - Input and Output
Find the error in this code:
print('It\'s a sunny day')
ANo error, prints correctly
BSyntaxError due to wrong escape
CMissing closing quote
DBackslash printed literally
Step-by-Step Solution
Solution:
  1. Step 1: Analyze the string and escape

    The string uses single quotes and escapes the single quote inside with \' correctly.
  2. Step 2: Confirm output correctness

    This prints: It's a sunny day without error.
  3. Final Answer:

    No error, prints correctly -> Option A
  4. Quick Check:

    Correct use of \' escapes single quote inside single quotes [OK]
Quick Trick: Escape single quote inside single quotes with \' [OK]
Common Mistakes:
MISTAKES
  • Not escaping single quote inside single quotes
  • Using double quotes incorrectly
  • Syntax errors from missing escape

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Python Quizzes