Logical operators are used to comparing multiple relational expressions.
In nesting where one if statement within another if statement because of that, multiple statements will execute and code got lengthy.
For solving this you can use logical operators by using that combine more than one relational expression and according to logical operator return true or false.
They are 3 logical operators in Python –
- And
- Or
- Not