>>> 1 and 2 and 33>>> False and 1 and 2false>>> 1 and 2 and 3 and 44>>> 1 and 2 and 3 and falsefalse>>> 1 or 2 or 31>>> false or 1 or 21>>> 1 and 2 and 3 or FALSE and 13
Boolean operations are performed in Python and and OR, but the actual value is returned.
1. All and, if true, returns the last variable value, or False to return the first false value
2. All or, returns the last value if both are false, and if true, returns the first truth
3.and and OR:
>>> 1 and 2 or false2>>> False and 1 or 22
(A and B) or C: If A and B are true then the result is B, if A and B is false, the result is C, in fact, the same principle as and and or, similar to C to bool? A:b
Also: and priority is higher than or
>>>false and 1 or 22>>> 1 or 2 and false1>>> (1 or 2) and Falsefalse
From the above 3 examples, the first one to determine the priority of or is not and high, the following 2 examples can be known and and or priority cannot be the same, if the same, the 2nd example of the result is false?
Python and And OR