The if-else statement is similar to if statement except the fact that, it also provides the block of the code for the false case of the condition to be checked. If the condition provided in the if statement is false, then the else statement will be executed.
syntax:-
if conditional expression: Body of if else: Body of else
e.g.,
i = 25; if (i < 10): print ("i is smaller than 10") else: print ("i is greater than 10")
Output- i is greater than 10
This is all about if-else statement in python.