Python supports the usual logical conditions from mathematics:
- Equals: a == b
- Not Equals: a != b
- Less than: a < b
- Less than or equal to: a <= b
- Greater than: a > b
- Greater than or equal to: a >= b
Else Statement :
And operator and Or operator
AND :The and keyword is a logical operator, and is used to combine conditional statements:
OR : logical operator if any one of the condition is true
Loops in python :
There are two loops in python :
While loops :
While loop is the entry control loop i.e it will keep on iterate until the condition is false :
For Loops :
A for loop is used for iterating over a sequence (that is either a list, a tuple, a dictionary, a set, or a string).
The most important thing to remember while using for loop is to correctly go through the indentation , a wrong indentation will make the whole process faulty .
These were some of the simple example working if conditional statement and working with Loops in python .
Happy Learning and Sharing !! .