Priority level
1. And and 2. or or 3. Not non-
Operation
Keep in mind that the number nonzero is false for true , and true to true false for false.
any one really is true, the same false is False (because to check whether there is true, So the false case value is the last False value , for example: 0 or False is false;false or 0 is 0. True, the value is the first truth , for example: 0 or 1 or 2 is 1;0 or False or 2 is 2 )
any one false is False, the same true as true (because to check whether there are false, So the real case is the last true value , for example: True and 1 is 1;1 and true is true. False in case the value is the first false value , for example: 0 and 1 and 2 for 0;true and false for False;true and 0 and False for 0)
Not: Negates the result of a high-priority operation , the value is Boolean (2 is true, negation is false: false)
Not 2:false
Not 1 and 2:false
Not 1 or 2:false
Not 1:true
Not 0:true
In fact, not just in Python, all languages follow this logic, and the question may be
operator not, and, or in Python