# Arithmetic Operators in Python [With Examples]

60

In this tutorial, you will learn about arithmetic operators in Python with examples. In Python, you can use arithmetic operators to perform Mathematical operations such as addition, multiplication, division, etc.

Python arithmetic operators are binary, which means that it requires two operands to operate.  The value on which the operators operate is known as operands. For example, in this case, `x = 3 + 4` 3 & 4 are the two operands, and addition (+) is the arithmetic operator.

Also ReadHow to Create Python Empty Set

## Arithmetic Operators in Python [With Examples] • Subtraction (-)
• Multiplication (*)
• Division (/)
• Floor Division (//)
• Modulus (%)
• Exponentiation (**)

To find the sum of two numbers in Python, you can use the addition operator, represented by the + symbol.

Syntax: a + b

Example:

```a = 10
b = 3
print("Sum of two numbers using addition operator is ", a + b)```

Output:

`Sum of two numbers using addition operator is 13`

## 2. Subtraction Operator

Use the subtraction operator in Python to find the difference between the two numbers. You can perform a subtraction operator by using the – symbol.

Syntax: a – b

Example:

```a = 10
b = 3
print("Difference of two numbers using subtraction operator is ", a - b)```

Output:

`Difference of two numbers using subtraction operator is 7`

Also ReadHow to Exit Python Program [4 Methods]

## 3. Multiplication Operator

To calculate the product of two numbers, you can use the multiplication operator, represented by the * symbol.

Syntax: a * b

Example:

```a = 10
b = 3
print("Multiplication of two numbers is ", a * b)```

Output:

`Multiplication of two numbers is 30`

Also ReadHow to Convert Python Tuples to Lists

## 4. Division Operator

You can use the division operator to find the quotient when the first operand is divided by the second. The / symbol represents it.

Syntax: a / b

Example:

```a = 10
b = 3
print("Division of two is ", a / b)```

Output:

`Division of two is 3.3333333333333335`

## 5. Floor Division Operator

To find the floor of the quotient when the first operand is divided by the second, you can use the floor division operator, which is // in Python.

Syntax: x // y

Example:

```a = 10
b = 3
print("Floor division of two numbers is ", a // b)```

Output:

`Floor division of two numbers is 3`

Also ReadPython For Loop Index With Examples

## 6. Modulus Operator

The modulus operator (%)

Syntax: a % b

Example:

```a = 10
b = 3
print("Remainder when a is divided by b is", a % b)```

Output:

`Remainder when a is divided by b is 1`

## 7. Exponentiation Operator

Syntax: a ** b

Example:

```a = 10
b = 3
print("a raised to the power b is", a ** b)```

Output:

`a raised to the power b is 1000`

## Python program to do arithmetical operations

```num1 = 34
num2 = 5
sum = num1 + num2
subtraction = num1 - num2
print("Subtraction of two numbers", subtraction)
multiply = num1 * num2
print("Multiplication of two numbers", multiply)
division = num1 / num2
print("Division of two numbers", division)
floordivision = num1 // num2
print("Floor division of two numbers", floordivision)
exponentiation = num1 ** num2
print("Exponentiation of two numbers", exponentiation)
modulus = num1 % num2
print("Modulus of two numbers", modulus)```

Output: