IF-ELSE-ELIF-2

Sometimes we need to use nested if-else in our program. Nested if-else means if-else inside an if-else.

In the above example, we have used if-else inside else, this is called nested if-else. if you only have single nested query then it may look good, but when you have multiple nested queries it becomes complicated to manage. You can use elif in that case. Now converting above code with elif.

"elif" is more like else-if statement.

Run above examples and see th results.

 

About the author

akarperiwal

0 Comments

Please login to comment