Python – If..Else.. Statements:

In this tutorial, we will discuss about the “if” Condition statement. Let us understand how this “if” statements work. There will be 2 parts in the “if” statement.

They are “if” and “elif”, “else” which is optional. when the “if” condition satisfies then it executes the program inside that else it execute the program inside “elif” or “else” statements.

Syntax:

Below is the example of If.. Else:

Example 1:

Example 2: