Answers for "how to get fractional value of a number using python"

3

python float to fraction

>>> from fractions import Fraction
>>> Fraction(0.25)
Fraction(1, 4)
Posted by: Guest on April-30-2021
0

python numphy how to use fractions

from fractions import Fraction
num1=Fraction(1, 3)
num2=Fraction(1, 7)
print(num1*num2)
Posted by: Guest on October-01-2021

Code answers related to "how to get fractional value of a number using python"

Python Answers by Framework

Browse Popular Code Answers by Language