Module 12 of 20 · Text
The print() function - the escape and newline characters 2
The print() function - the escape and newline characters
This convention has two important consequences:
- If you want to put just one backslash inside a string, don't forget its escaping nature - you have to double it, e.g., such an invocation will cause an error:
print("\")
while this one won't"
pritn("\\") - Not all escape pairs (the backslash coupled with another character) mean something.
Experiment with your code in the editor, run it and see what happens.