# Arithmetic Operators in Python | Python Arithmetic Operator with Example

Arithmetic Operators in Python - Addition, Subtraction, Multiplication, Division, Modulus, Exponent, Floor Division.

## What are Arithmetic Operators in Python

An arithmetic operators in python are used to perform mathematical calculation between two operands like addition, subtraction, multiplication etc.

There are 7 types of arithmetic operators in Python:

2. Subtraction
3. Multiplication
4. Division
5. Modulus
6. Exponent
7. Floor Division

### All Arithmetic Operators in Python with Syntax

SymbolOperationExample
-Subtractionx - y
*Multiplicationx * y
/Divisionx / y
%Modulusx % y
**Exponentx ** y
//Floor Divisionx // y

Let's understand each operator one by one with the help of examples and know how to use arithmetic operators in Python:

Addition operator in Python is used to perform addition between two operands or values. It is used to find the sum of two values.

It is represented by "+".

##### Example Program
``````a=10
b=5
c=a+b
print(c)```
```

Output:

``15``

In the above program the values of variable "a" and "b" are added using the "+" operator and the result is saved in third variable "c" and finally the result is printed on the screen using the print statement.

### Subtraction Operator

Subtraction operator in Python is used to perform subtraction between two operands or values.

It is represented by "-".

##### Example Program
``````a=10
b=5
c=a-b
print(c)
``````

Output:

``5``

In the above program the values stored in variable "b" is subtracted from the value stored in variable "a" using the "-" operator and the result is saved in third variable "c" and finally the result is printed on the screen using the print statement.

### Multiplication Operator

Multiplication operator in Python is used to perform multiplication between two operands or values. It is used to find the product of two values.

It is represented by "*".

##### Example Program
``````a=10
b=5
c=a*b
print(c)
``````

Output:

``50``

In the above program the values of variable "a" and "b" is multiplied using  the "*" operator and the product of the operand is assigned to the third variable "c" whose result is printed on the screen using the print statement.

### Division Operator

Division operator in Python is used to perform division between two operands or values. It gives quotient when first operand is divided by the second.

It is represented by "/".

##### Example Program
``````a=10
b=5
c=a/b
print(c)
``````

Output:

``````2
``````
In the above example, the value of first operand that is "a" is divided by the value of second operand i.e "b" using the "/" operator.

### Modulus Operator

Modulus operator in Python is used to find the modulus value or remainder when first operand is divided by second one.

It is represented by "%".

##### Example Program
``````a=10
b=5
c=a%b
print(c)```
```

Output:

``0``

In general mathematics, when we divide two number then we get two things one is quotient and another is remainder. Similarly, in the above program when we find the modulus of two operands i.e a and b using the % operator then we get remainder as a result.

### Exponent Operator

Exponent operator in Python is used to raise power of one operand to the other.

It is represented by "**".

##### Example Program
``````a=10
b=2
c=10**2
print(c)
``````

Output:

``````100
``````

In given program, the value of b is raised to the power of a i.e 2 is raised to the power of 10. (10^2).

### Floor Division Operator

Floor division operator in Python is use to perform division operation between two operands and get the result in round figures.

It is represnted by "".

##### Example Program
``````a=7
b=2
c=a//b
print(c)
``````

Output:

``````3
``````
In the above program, the value stored in first operand is divided by second operand and if the value after division is in decimal then all the digit after decimal is removed and number before decimal point is printed.

For example in simple division when 7 is divided by 2 then the result will be 3.5 but in floor division, digit after point is removed and hence 5 is removed and only 3 is printed.