You are looking at a string representation, which itself is a true Python string literal.
\\ itself is just one slash, but is displayed as an escaped character to make the value a valid Python literal string. You can copy and paste this line back into Python and this will give the same value.
Use print st.replace('&','\\') to see the actual value displayed, or check the length of the resulting value:
>>> st = "a&b" >>> print st.replace('&','\\') a\b >>> len(st.replace('&','\\')) 3
source share