Arithmetic Operators

noun

say it: “uh-RITH-muh-tik OP-uh-ray-terz” /əˈrɪθmətɪk ˈɑpəreɪtərz/

The symbols that do math in Python: + add, - subtract, * multiply, / divide, // divide and drop the decimals, % remainder and ** power.

What are the arithmetic operators in Python?

Arithmetic operators do math: + add, - subtract, * multiply, / divide, // divide and drop the decimals, % remainder, ** power.

print(10 + 3)   # 13
print(10 / 3)   # 3.3333333333333335
print(10 // 3)  # 3
print(10 % 3)   # 1
print(2 ** 3)   # 8

In a sentence

  • “The receipt uses arithmetic operators to work out price * quantity plus tax.”
  • “Of the arithmetic operators, % gives the remainder: 10 % 3 is 1.”

Level: Novice · More Python terms at this level

Updated

In other subjects