1

I am a beginner in Python and I am trying to print a raw string as it is, "c:\doc\neena":

print (r'c:\doc\neena’)

but it's showing the error:

File "<stdin>", line 1
    print (r'c:\doc\neena’)

SyntaxError: EOL while scanning string literal
donjuedo
  • 2,475
  • 18
  • 28
Wellme
  • 13
  • 2
  • Does this answer your question? [python: SyntaxError: EOL while scanning string literal](https://stackoverflow.com/questions/3561691/python-syntaxerror-eol-while-scanning-string-literal) – arie Jan 24 '20 at 07:40
  • 3
    Your quote doesn't look like the right character. Make sure its a proper single quote: ' – Loocid Jan 24 '20 at 07:42
  • 1
    Just to clarify for the OP, the invalid quote character here is the rightmost quote. I am not sure how that quote entered your code but I suspect that you may not be using a text editor or IDE to edit your code. If you're using a word processor stop doing that. Note that StackOverflow's sytaxt highlighting gives you a clue to the problem. The close parentheses is the same color as the string. When the string is terminated correctly the parentheses is a different color. – Steven Rumbalski Jan 24 '20 at 13:36

0 Answers0