-
Operators perform simple operations such as additions, comparisons, etc., on variables and values.
-
Python supports the following types of operators; we will look at some commonly used operators in this tutorial.
Arithmetic Operators
Using Python, we can perform some basic arithmetic operations such as addition, subtraction, multiplication, etc.
Example:
1
x = 2
1
y = 3
1
x + y
1
x * y
Arithmetic 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)