And Or in Python : And Or : Language Basics PYTHON examples


PYTHON examples » Language Basics » And Or »

 

And Or in Python


And Or in Python: int, empty list and empty dictionary

print 32        # less-than: return or 


print or 3or 2      return left operand if true
                        else return right operand (true or false)
print [] or 3

print [] or {}


print and 3and 2    return left operand if false
                          else return right operand (true or false)

print [] and {}


print and []




           
       



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON examples

 Navioo Language Basics
» And Or