Categories
Python Programming

Arithmetic Operators

There are seven basic arithmetic operators in the Python programming language.

They are:

  1. Addition
  2. Subtraction
  3. Multiplication
  4. Division
  5. Integer Division
  6. Exponentiation
  7. Modulus

Addition

This is represented by the + symbol. It adds two numbers together and gives their sum.

Subtraction

This is represented by the – operator. It takes the value on the right from the value on the left to give the difference ot the two values.

Multiplication

This is represented by the * operator. It multiplies the value on the left with the value on the right to give a product of the two.

Division

This is represented by the / operator. It divides the value on the left with the value on the right to give the quotient.

Integer Division

This is a special form of division represented by //. It gives the whole number value of the quotient.

Exponentiation

This is represented by the ** operator. It gives the result of a value raised to another value.

Modulus

This is the remainder of division of one number by another number. It is used to test if the number on the right is a factor of the number of the left.

Conclusion

The above operators are how arithmetic is done in the Python programming language on a basic level.