IF Statement in Python
If check the condition if condition is true then do something otherwise do nothing.
Syntax:-
if(condition):
statement
statement
IF else Statement in Python
If check the condition if condition is true then do something otherwise do something else.
Syntax:-
if(condition):
statement
else:
statement
statement
else:
statement
Multiple IF Statement in Python
If check the condition if condition is true then do something otherwise check the next condition.
Syntax:-
if(condition):
statement
if(condition):
statement
statement
if(condition):
statement
Multiple IF else if Statement in Python
If check the condition if condition is true then do something otherwise check the next condition.
Syntax:-
if(condition):
statement
elif(condition):
statement
else:
statement
statement
elif(condition):
statement
else:
statement