fbpx
Mathikere, Bangalore

Email Us

info@automationtestingtool.com

Call Us

+91 98 4583 4306

New Location @

Koramangala

If Else Statement In Python

Python Nested If else statement


When there is an if statement (or if..else or if..elif..else) is present inside another if statement (or if..else or if..elif..else) then this is calling the nesting of control statements.

Nested if..else statement example

Here we have a if statement inside another if..else statement block. Nesting control statements make us check multiple conditions

Syntax of Nested if else

If condition 1:    
 If condition 2:            
Statement     
 else:           
statement  
else:      
Statement 

.Note: when condition 1 is true then only condition 2 will be check.