Python For Loop Statement

In this page you learn of nested if else statement there may be a situation when you want to check for multiple condition to be true. you can use the nested if construct.

Syntax

If statement:  
    Body  
elif statement:  
    Body  
else:  
    Body

Example

a=10  
if a>=20:  
    print "Condition is True"  
else:  
    if a>=15:  
        print "Checking second value"  
    else:  
        print "All Conditions are false"