How do I tell Python I want to do the following:
if cond1 and (not cond2 or not cond2)
I want the expressions in the parenthesis to execute first and then feed the result to and.
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.
Like most languages, python evaluates expressions left-to-right, so you simply need to put them in the order that you want them to be evaluated: