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:

Continue Reading - Create a FREE Account

If you like to keep on reading, register now!

  • Get Instant Access to this full lesson + 333 more.
  • Learn CCNA, CCNP and CCIE R&S. Explained as simple as possible.
  • Unlock Access to 810 lessons by becoming a member.
  • Content created by Rene Molenaar (CCIE #41726)
🔥 2314 people registered in the last 30 days

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