In a Python 3.7 shell I get some unexpected results when escaping strings, see examples below. Got the same results in the Python 2.7 shell.
A quick read in the Python docs seems to say that escaping can be done in strings, but doesn't seem to say it can't be used in the shell. (Or I have missed it).
Can someone explain why escaping doesn't seem to work as expected.
Example one:
input:
>>> "I am 6'2\" tall"
output:
'I am 6\'2" tall'
while >>> print("I am 6'2\" tall")
returns (what I expected):
I am 6'2" tall
(I also wonder how the backslash, in the unexpected result, ends up behind the 6?)
Another example:
input:
>>> "\tI'm tabbed in."
output:
"\tI'm tabbed in."
When inside print() the tab is replaced with a proper tab. (Can't show it, because stackoverflow seems the remove the tab/spaces in front of the line I use inside a code block).