Python: How does python executes multiple boolean in one statement?

Viewed 92

With following condition, what should Python return? In which sequence the condition will get executed?

True or False and False and True

2 Answers

Like @Dean Dumitru has said and like it said in this answer here; the AND has a higher precedence than OR.

Hence, your condition could be rewritten in this way:

True or ((False and False) and True) -> True or (False and True) -> True or False -> TRUE
Related