ID EN
Built-in Types

as_integer_ratio

Python 3.11

Return a pair of integers whose ratio is exactly equal to the original integer and with a positive denominator. The integer ratio of integers (whole numbers) is always the integer as the numerator and 1 as the denominator.

Syntax

PYTHON
int.as_integer_ratio()