Arithmetic operators are mathematical functions used on numbers to perform basic arithmetic operations.
The most common arithmetic operators in Python are:
Addition (+): Used to add two or more numbers together.
Subtraction (-): Used to subtract one number from another.
Multiplication (*): Used to multiply two or more numbers together.
Division (/): Used to divide one number by another.
Modulus (%): Used to find the remainder after division.
Exponentiation (** or ^): Used to raise a number to a power.
Floor Division(//): Used to perform integer division, where the result is rounded down to the nearest integer.
# Addition
a = 5
b = 10
c = a + b
print(c) # Output: 15
# Subtraction
d = 20
e = 7
f = d - e
print(f) # Output: 13
# Multiplication
g = 3
h = 4
i = g * h
print(i) # Output: 12
# Division
j = 25
k = 5
l = j / k
print(l) # Output: 5.0
# Modulus
p = 25
q = 6
r = p % q
print(r) # Output: 1
# Exponentiation
s = 2
t = 3
u = s ** t
print(u) # Output: 8
# Floor Division
m = 25
n = 6
o = m // n
print(o) # Output: 4
Markdown for AI
A clean, structured version of this page for AI assistants and LLMs.
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy.
Arithmetic operators are mathematical functions used on numbers to perform basic arithmetic operations.
The most common arithmetic operators in Python are: