Python Lessons – 1.4 Other numeric operations

Python Lessons - 1.4 Other numeric operations

Elevation to power

The elevation to power can be done through the operator **

>>> 2 ** 4
16

Quotient and Rest

Sometimes in some algorithms it is necessary to know in the division operations, not the result, but the quotient and rest values. The operation is often also called a module (11 module 3)

>>> 11 // 3
2
>>> 11 % 3
3

⇐ Go to Python Lesson 1.3 – Floating numbers

Go to Python Lesson 1.5 – Strings ⇒

Leave a Reply