python tutorial - Nested If | Nested If Else Statement - learn python - python programming
![python nestedif](https://wikitechy.com/tutorials/python/img/python-images/python-nestedif.gif)
Learn Python - Python tutorial - python nestedif - Python examples - Python programs
- The if...else statement executes two different codes depending upon whether the test expression is true or false. Sometimes, a choice has to be made from more than 2 possibilities.
- The nested if...else statement allows you to check for multiple test expressions and execute different codes for more than two conditions.
![nested if else statement python](https://wikitechy.com/tutorials/python/img\python-images\nested-if-else-statement-python.png)
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"
Output:
All Conditions are false.
Wikitechy tutorial site provides you all the learn python , online python programming course python programming class online ,
python coding for dummies , python programming classes online , online training python , online python training , python programming
online course , python training classes