Topics

Python Control Flow : Conditions (If and Else).

Python Control Flow : Conditions (If and Else)


Decision making is an anticipation of conditions occurring while execution of the program and specifying actions taken according to the conditions.

Flow Chart -1 

Generally conditional statements are used to perform decision making challenges in any programming language. In this blog we will learn how to run block of code with if ,else and else if statements. 
Possibly there are three scenarios where if else statements can be used. 


If Statement : This statement is used if the condition is true or not. if condition is true the block of code gets executed. 


If Else Statement : This statement is used when there are two situations , if condition is true then block of code inside if gets executed else the block of code inside else conditions gest excecated.


Else if statement : This is similar to the if else statement but here it allows to use multiple if else blocks.

If statement : 

syntax 
                        if expression:
                                statement

Flow Chart -2

If-Else statement : 

syntax 
                        if expression:
                                statement

                        else :
                                statement
Flow Chart -3