Bird
0
0

What does the escape character \t do in a Python string?

easy📝 Conceptual Q1 of 15
Python - Input and Output
What does the escape character \t do in a Python string?
AInserts a new line
BEnds the string
CInserts a backslash
DInserts a tab space
Step-by-Step Solution
Solution:
  1. Step 1: Understand the meaning of \t

    The escape character \t is used to insert a horizontal tab space in the output string.
  2. Step 2: Compare with other escape characters

    Unlike \n which inserts a new line, \t adds a tab space, which is a horizontal gap.
  3. Final Answer:

    Inserts a tab space -> Option D
  4. Quick Check:

    Escape character \t = Inserts a tab space [OK]
Quick Trick: Remember \t means tab space, not new line or backslash [OK]
Common Mistakes:
MISTAKES
  • Confusing \t with \n
  • Thinking \t inserts a backslash
  • Assuming \t ends the string

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Python Quizzes