Pythondex

Tutorial

Arithmetic Operations in Python

Python can perform basic arithmetic operations such as addition, subtraction, multiplication, division, and modulus. These are fundamental for working with numbers.

Addition (+)

Use the + operator to add numbers:

Subtraction (-)

Use the - operator to subtract numbers:

Multiplication (*)

Use the * operator to multiply numbers:

Division (/)

Use the / operator to divide numbers. The result is always a float:

Modulus (%)

The % operator gives the remainder of a division:

Quick Recap

  • + Addition
  • - Subtraction
  • * Multiplication
  • / Division (result is float)
  • % Modulus (remainder)

These operations form the foundation of numerical calculations in Python. Next, you'll practice using them in exercises.