Python: How does python executes multiple boolean in one statement?
Become part of the top 3% of the developers by applying to Toptal https://topt.al/25cXVn
--
Music by Eric Matyas
https://www.soundimage.org
Track title: Book End
--
Chapters
00:00 Question
00:25 Accepted answer (Score 1)
00:47 Answer 2 (Score 3)
01:06 Thank you
--
Full question
https://stackoverflow.com/questions/5244...
Accepted answer links:
[here]: https://stackoverflow.com/questions/1667...
Answer 2 links:
http://www.mathcs.emory.edu/~valerie/cou...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#python #booleanlogic
#avk47
--
Music by Eric Matyas
https://www.soundimage.org
Track title: Book End
--
Chapters
00:00 Question
00:25 Accepted answer (Score 1)
00:47 Answer 2 (Score 3)
01:06 Thank you
--
Full question
https://stackoverflow.com/questions/5244...
Accepted answer links:
[here]: https://stackoverflow.com/questions/1667...
Answer 2 links:
http://www.mathcs.emory.edu/~valerie/cou...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#python #booleanlogic
#avk47
ANSWER 1
Score 3
AND has a higher precedence than OR.
True or False and False and True -> True or TRUE and True -> True or TRUE -> TRUE.
http://www.mathcs.emory.edu/~valerie/courses/fall10/155/resources/op_precedence.html
ACCEPTED ANSWER
Score 1
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