mirror of
https://github.com/satwikkansal/wtfpython
synced 2024-11-22 11:04:25 +01:00
commit
9b3f86958a
2
README.md
vendored
2
README.md
vendored
@ -1228,7 +1228,7 @@ True
|
|||||||
>>> print("\n")
|
>>> print("\n")
|
||||||
|
|
||||||
>>> print(r"\\n")
|
>>> print(r"\\n")
|
||||||
'\\\\n'
|
'\\n'
|
||||||
```
|
```
|
||||||
- This means when a parser encounters a backslash in a raw string, it expects another character following it. And in our case (`print(r"\")`), the backslash escaped the trailing quote, leaving the parser without a terminating quote (hence the `SyntaxError`). That's why backslashes don't work at the end of a raw string.
|
- This means when a parser encounters a backslash in a raw string, it expects another character following it. And in our case (`print(r"\")`), the backslash escaped the trailing quote, leaving the parser without a terminating quote (hence the `SyntaxError`). That's why backslashes don't work at the end of a raw string.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user