Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (55.6k points)

Can anyone tell me what is escape sequence in python?

1 Answer

0 votes
by (119k points)

In Python strings, the escape character is a special character which is denoted as "\". It is used for creating certain whitespace characters like:

  • "\t" is a tab
  • "\n" is a new line
  • "\r" is a carriage return.

Here is an example:

>>> print 'apple\torange'

apple     orange

>>> print 'apple\norange'

apple

orange

I recommend enrolling in this Python Course by Intelllipaat to learn Python.

Also, watch this video on Python Sequences:

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Nov 2, 2020 in Python by Sudhir_1997 (55.6k points)
0 votes
1 answer
0 votes
1 answer
asked Nov 2, 2020 in Python by Sudhir_1997 (55.6k points)

Browse Categories

...