Logical Operators in python
Logical operators combine multiple conditions.
| Operator | Description |
| and | Returns True if both conditions are True |
| or | Returns True if at least one condition is True |
| not | Reverses the result |
Example
age = 20
print(age > 18 and age < 30)
print(age > 18 or age > 50)
print(not(age > 18))
Output
True
True
False