Answers for "fraction in python"

2

reduced fraction python

>>> from fractions import Fraction
>>> Fraction(98, 42)
Fraction(7, 3)
Posted by: Guest on May-10-2020
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

Python Answers by Framework

Browse Popular Code Answers by Language