Arithmetic Operators

In mathematics, we can take values which are like variables, and utilize arithmetic operators to perform calculations. For simple calculations, I tried these out at the Python command prompt, the results are in the right-most column.

Symbol

Function

Example

**

Exponentiation

>>> 2**3

8

*

Multiplication

>>> 2*2

4

/

Division

>>> 9/3

3.0

%

Modulus

>>> 10%3

1

//

Floor Division

>>> 26//4

6

+

Addition

>>> 1+2

3

-

Subtraction

>>> 1-2

-1