Python Arithmetic Operators

Arithmetic operators are one of the Python operators and we can use them to perform calculations like addition, subtraction, multiplication, etc. In this lesson, I’ll show you the different options.

Addition

We can add two or more numbers together:

>>> 1 + 1

Will show this output:

2

Subtraction

Subtract a value:

>>> 5-1

Will show this output:

4

Multiplication

We can also multiply two values:

>>> 4 * 4

Will show this output:

16

Division

Or do a division:

>>> 9 / 3

Will show this output:

3.0

Modulus

We can also calculate the remainder of a division:

>>> 11 % 3

Will show this output:

2

Exponentiation

Exponential calculations are also possible:

Unlock This Lesson for Free - No Credit Card Needed!

If you like to keep on reading, register now!

  • Learn CCNA, CCNP and CCIE R&S. Explained As Simple As Possible.
  • Get Instant Access to this Full Lesson, Completely for Free!
  • Unlock More to Read. More Lessons Added Every Week!
  • Content created by Rene Molenaar (CCIE #41726)
2298 Sign Ups in the last 30 days

Ask a question or start a discussion by visiting our Community Forum