Condition

Indention: It is used to declare a block in Python if two statements are at the same level, then they are at the part of the same block.


If else:

If: It is used to test conditions, if the condition is true it executes the block of statement.

a=50

if a>40:

    print(a)


if a>40 and a<60:

    print(a)


else: it executes when the condition is false.

ex: 

check whether a person is eligible to vote or not

Check whether a number is divisible by 2 or not


elif: It allows us to create multiple conditions, and execute specific blocks of statement depending upon the true condition.


ex: check the grade

Grade A: 90-100 

Grade B: 80-90

Grade C: 70-80

Grade D: less than 70