SyntaxFix
Write A Post
Hire A Developer
Questions
The result '\\&' is only displayed - actually the string is \&:
'\\&'
\&
>>> str = '&' >>> new_str = str.replace('&', '\&') >>> new_str '\\&' >>> print new_str \&
Try it in a shell.