Arithmetic operators in Python allow you to perform basic mathematical calculations on numeric values. These operators include addition, subtraction, multiplication, division, and more.
- Addition (+): Adds two numbers.
- Subtraction (-): Subtracts the right operand from the left operand.
- Multiplication (*): Multiplies two numbers.
- Division (/): Divides the left operand by the right operand (results in a floating-point number).
- Floor Division (//): Divides the left operand by the right operand and rounds down to the nearest whole number.
- Modulus (%): Returns the remainder of the division of the left operand by the right operand.
- Exponentiation ():** Raises the left operand to the power of the right operand.
a = 5
b = 3
result = a + b
print(result) # Output: 8x = 10
y = 7
result = x - y
print(result) # Output: 3