Arithmetic Operators

Arithmetic operators

  • + Addition
  • - Subtraction
  • * Multiplication
  • / Division
  • % Mod (the remainder after dividing)
  • ** Exponentiation (note that ^ does not do this operation, as you might have seen in other languages)
  • // Divides and rounds down to the nearest integer

The usual order of mathematical operations holds in Python, which you can review in this Math Forum page if needed.

Bitwise operators are special operators in Python that you can learn more about here if you'd like.

Examples

  1. print(3 + 5) # 8
  2. print(1 + 2 + 3 * 3) # 12
  3. print(3 ** 2) # 9
  4. print(9 % 2) # 1
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram