Skip to main content

Python: Arithmetic Operators

Arithmetic Operators are used to perform mathematical operation like addition, multiplication, division, subtraction, etc.

Operators Description Syntax
Addition(+) Add two operands. a+b
Subtraction(-) Subtract two operands. a-b
Multiplication(*) Multiply two operands. a*b
Division(/) Divides the first operand by the second. a/b
Modulus(%) It returns the remainder when first operand is divided by the second. a%b
Exponentiation(**) It returns first raised to power second. a**b
Floor division(//) It divides that results into whole number adjusted to the left in the number line. a//b


a = 4
b = 3

c = a+b
print("Addition: c = ",c)

c = a-b
print("Subtraction: c = ",c)

c = a*b
print("Multiplication: c = ",c)

c = a/b
print("Division: c = ",c)

c = a%b
print("Modulus: c = ",c)

c = a**b
print("Exponentiation: c = ",c)

print("FloorDivision: c = ",c)


ddition: c =  7
Subtraction: c =  1
Multiplication: c =  12
Division: c =  1.3333333333333333
Modulus: c =  1
Exponentiation: c =  64
FloorDivision: c =  1
Submitted by devanshi.srivastava on June 25, 2021

Devanshi, is working as a Data Scientist with iVagus. She has expertise in Python, NumPy, Pandas and other data science technologies.


At ProgramsBuzz, you can learn, share and grow with millions of techie around the world from different domain like Data Science, Software Development, QA and Digital Marketing. You can ask doubt and get the answer for your queries from our experts.