What other characters need to be escaped in a string?
Answer
You’ll typically discover these as you code and realize your output looks odd, but some common ones are: \\, which will display the backslash \t, which displays a tab-length spacing \n, which displays a new line
and \' and \", which display the single and double quotes
Escapement is how we tell the parser to treat the value following it as a printable character.
print ("\"\"")
will output, "" By escaping the character it is no longer interpreted as a string delimiter, but a string character.
From the early days, (not sure of the origins, exactly) we have what used to be called, escape sequences. They were principally used to perform operations on the output stream, either terminal or line printer.
\n => newline
\t => tab
among many others which can be researched. Not important, here. It’s enough to focus in on the printable character aspect.
What this means is the \ is not a printable character unless we escape it.
print ("\\")
will output, \. This is an example of what we call special characters and if we wish to use them in certain sequences as printable, then they need escapement.
Again, stick with the focus, and let this other stuff take up some of your weekend reading.