I'm experimenting with the backspace character \b
in Python strings. I tried this:
>>> s = "The dog\b barks"
>>> print(s)
The do barks
This behaves as expected. The g
character disappears because of the \b
backspace.
Now I try this:
>>> s = "The dog barks\b"
>>> print(s)
The dog barks
Strange... the s
character didn't disappear. Why?
Note:
I work on a Windows 10 PC and did these experiments in the Windows cmd prompt (the terminal). I run Python 3.6