a = '\a'
>>> b = '\7'
>>> a == b
True
>>>
How can a and b be equal? Can someone give the reason?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
\ais escaped character sequence for control character BEL (a for alert). The character’s ASCII code is also happened to be 7, which matches the octal value in the escape sequence\7.References:
http://en.wikipedia.org/wiki/Bell_character
http://docs.python.org/reference/lexical_analysis.html#string-literals