What are the arithmetic operators?

  • + for addition
  • – for subtraction
  • * for multiplication
  • / for division
  • % for modulus
  • ** for exponent
  • // for floor division
#examples
>>> 1+3
4

>>> 1-3
-2

>>> 2*3
6

>>> (2+3)*6
30

>>> 7%4
3

>>> 7//4
1

>>> 7/4
1.75

>>> 2**3
8

>>> num1 = 2
>>> num2 = 3
>>> num1+num2
5
Advertisements