IF Statement in Python

If check the condition if condition is true then do something otherwise do nothing.

Syntax:-

if(condition):
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

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

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