bugl
bugl
HomeLearnPatternsPathsSearchPremium
HomeLearnPatternsPaths

Loading lesson path

Learn/Python/Foundations
Python•Foundations

Python Arithmetic Operators

Arithmetic Operators

Arithmetic operators are used with numeric values to perform common mathematical operations:

OperatorNameExample
+Additionx + y
-Subtractionx - y
*Multiplicationx * y
/Divisionx / y
%Modulusx % y
**Exponentiationx ** y
//Floor divisionx // y

Division in Python

Python has two division operators

  • / - Division (returns a float)
  • // - Floor division (returns an integer)

Example

x = 12

y = 5

print(x / y)

Example

x = 12

y = 5

print(x // y)

Previous

Python Operators

Next

Python Assignment Operators