Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python as integer ratio

x = 0.25
print(x.as_integer_ratio())       # Output:  (1, 4)

y = x.as_integer_ratio()
print(y)						  # Output:  (1, 4)

numerator, denominator = x.as_integer_ratio()
print(numerator / denominator)    # Output:  0.25
 
PREVIOUS NEXT
Tagged: #python #integer #ratio
ADD COMMENT
Topic
Name
7+1 =