-1

I would like to print a backslash character:

\

But whne I try to use escape characters

print(\"\"\)

I get a syntax error. I have looked into ecape characters, however is their a specific one for backslash ()?

Lyra Orwell
  • 1,048
  • 4
  • 17
  • 46

2 Answers2

2

If you do

print("\")

you are escaping the final quote.

You need to escape the backslash.

print("\\")
blueteeth
  • 3,330
  • 1
  • 13
  • 23
1

It is simple, just escape the escape character itself:

print("\\")