Use of Arithmetic Operators in Python:
“Arithmetic operators are used to perform mathematical operations on
numbers.”
1. Addition (+)
● Use: Adds two numbers.
● Example:
a = 10
b=5
result = a + b
print(result)
2. Subtraction (-)
● Use: Subtracts the second number from the first.
● Example
a = 10
b=5
result = a - b
print(result)
3. Multiplication (*)
● Use: Multiplies two numbers.
● Example
a = 10
b=5
result = a * b
print(result)
4. Division (/)
● Use: Divides the first number by the second. The result is a floating-point
number.
● Example
a = 10
b=5
result = a / b
print(result)
5. Modulus (%)
● Use: Returns the remainder of the division of the first number by the second.
● Example
a = 10
b=3
result = a % b
print(result)
7. Exponentiation (**)
● Use: Raises the first number to the power of the second number.
● Example
a=2
b=3
result = a ** b
print(result)