Product SiteDocumentation Site

4.4. Logical Operators

To do logical AND , OR we use and , or keywords. x and y returns False if x is False else it returns evaluation of y. If x is True, it returns True.
 
>>> 1 and 4
4
>>> 1 or 4
1
>>> -1 or 4
-1
>>> 0 or 4
4