Arithmetic operations in Python
- Minu k
- Jun 20, 2022
- 2 min read

Operators in Python
An operator is a character in mathematics and computer programming that represents an action, such as the arithmetic operator x, which symbolises multiplication. The Boolean operators, one of the most well-known sets of operators, are used in computer programmes to operate with true/false data.
Arithmetic operations
Arithmetic operations on groups and numbers are performed by this operator. In AHDL, the prefix and binary plus (+) and minus (-) symbols are supported arithmetic operators in Boolean expressions.
Addition, subtraction, multiplication, and other mathematical operations are performed using arithmetic operators.
+ Addition is a function that adds values on both sides of an operator.
- Subtraction
Subtracts the right hand operand from the left hand operand.
* Multiplication multiplies both sides of the operator's value.
Division / b / a = 2% divides left hand operand by right hand operand Modulus divides the left and right operands and provides the residual as b percent a = 0 ** Exponent Calculates the exponential (power) of the operators a**b =10 to the power 20.
/ Floor Division - When two operands are divided, the result is a quotient with the digits after the decimal point deleted. However, if one of the operands is negative, the result is floored, which means it is rounded away from zero (towards negative infinity).
Example
x = 20
y = 30
# Output: x > y is False
print('x > y is',x>y)
# Output: x < y is True
print('x < y is',x<y)
# Output: x == y is False
print('x == y is',x==y)
# Output: x != y is True
print('x != y is',x!=y)
# Output: x >= y is False
print('x >= y is',x>=y)
# Output: x <= y is True
print('x <= y is',x<=y)
x > y is False
x < y is True
x == y is False
x != y is True
x >= y is False
x <= y is True
Conclusion
Here, we learned about operators in python . Arithmetic Operators in Python with example .
If you want learned others operators in python check out types of operators in python .
Comments