0

What is use of backslash in python 3

How to use backslash in python 3

12th Dec 2019, 9:53 AM
Shardul Malkhare
Shardul Malkhare - avatar
1 Answer
+ 3
If you want to print print('a'b') Python will think, the string ends after the second quotation mark. Then you get an error. By writing print('a\'b') You tell Python: Please don't end the string here, just print the quotation mark. There are many other use cases. Backslash always starts a sequence of signs with a specific purpose besides just output.
12th Dec 2019, 10:06 AM
HonFu
HonFu - avatar