Introducing or : Boolean Operators « Operator « Python Tutorial






print 'a' or 'b'                                
print '' or 'b'                                      
print '' or [] or {}                                

def sidefx(): 
    print "in sidefx()" 
    return 1 
print 'a' or sidefx()








4.3.Boolean Operators
4.3.1.Boolean Operators
4.3.2.Understanding the Peculiar Nature of and and or
4.3.3.Introducing or
4.3.4.logically combine the Boolean results
4.3.5.Standard Type Boolean Operators