Wednesday 1 March 2017

Python 3 Conditional Operators

Python 3 Conditional Operators

The explanation programs for conditional operators is as follows,

'''Conditional Operation'''
a = 100
if a == 100:
    print ("true")
else:
    print ("false")

# result is true
if a <50:
    print ("less than 50")
else:
    if a > 50:
        print ("greater than 50")

# result is greater than 50
if a < 50:
    print ("less than 50")
elif a>50:
    print ("greater than 50")
    
# result is greater than 50











No comments:

Post a Comment