Chris Angelico <ros...@gmail.com> writes: > And of course, that means you have to escape the backslash if you want > to have one in the text. But all of this is just for putting *string > literals* into your source code. If it's not Python source code, these > rules don't apply. You can read a line of text from the user and it'll > be unchanged
To put it another way: The source code is not the value itself. The string value is created *from* the characters in the source code, and the sequence of characters in the string value may be different. When the string value comes from somewhere else, it bypasses this interpretation of source code — because it's not source code! String literals exist in your Python source code. They are not the same thing as the string value itself, and the sequence fo characters may be different. -- \ “Try adding “as long as you don't breach the terms of service – | `\ according to our sole judgement” to the end of any cloud | _o__) computing pitch.” —Simon Phipps, 2010-12-11 | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list