Boolean Operators : Boolean Operators « Operator « Python Tutorial






number = input('Enter a number between 1 and 10: ') 
if number <= 10: 
    if number >= 1: 
        print 'Great!' 
    else: 
        print 'Wrong!' 
else: 
    print 'Wrong!' 

if number <= 10 and number >= 1:
    print 'Great!' 
else:
    print 'Wrong!'








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