Computer Science, asked by 1805613007, 11 months ago

what is the use of escape sequence (\)in python programming language?​

Answers

Answered by arnavshetty2006
0

Answer:

Usually, the escape sequence is used to type/print characters that usually mean something else.

Example:

The following code will not execute, because there are 3 quotation marks:

print('I'm going to do something!')

The "I" has become its own string. "m going to do something!" isn't part of a string, resulting in an error. However, if you print using the escape sequence, it will work.

print('I\'m going to do something!')

Of course, you could always use "", but other situations will require the escape sequence.

Hope it helped!

Similar questions