- Operators are used to perform simple operations such as additions, comparisons etc on variables and values.
- Python supports the following types of operators, we will be looking at some of the commonly used operators.
Arithmetic Operators
We can perform some basic arithmetic operations such as addition, subtraction, multiplication, etc. using Python.
Example:
x = 2
y = 3
x + y # addition
x * y # multiplication
Aritmetic Operators: Meanings & Examples
Comparison Operator
- These are used to compare two values
- Gives a Boolean result (True/False)
Comparison Operators: Meanings & Examples
Logical Operator
- Logical operators are used to combine conditional statements
- Gives a Boolean result (True/False)