I have this code:
>>> char = 'A'
>>> 'A' == char
True
>>> ('A' or 'B') == char
True
Why does this not equal True?
>>> ('B' or 'A') == char
False
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.
Your expressions are not doing what you expect.
This actually evaluates to
'A', try it out in the interpreter!When you say
The interpreter is actually doing these steps:
But when you do
The interpreter does this:
What you probably wanted was: