Feb-20-2018, 11:58 PM
\ has a special meaning in Python. So you have to escape it if you want to print it.
Printing single \ is not going to work that way because you are escaping the close quote
Printing single \ is not going to work that way because you are escaping the close quote
>>> print("\") File "<stdin>", line 1 print("\") ^ SyntaxError: EOL while scanning string literalAs it is here.
>>> print("\"") "To print \ you have to escape it with another \
>>> print("\\") \Here you cannot escape 's' because '\s' do not have special mieaning.
>>> print("\s") \sBut '\n' represents a new line character.
>>> print("\n")So to print \n you have to escape the \
>>> print("\\n") \n