How to get fraction from integers in Python

1 Answer

0 votes
from fractions import Fraction 
   
print(Fraction(15, 30))
print(Fraction(12, 18))



'''
run:

1/2
2/3

'''

 



answered Apr 10, 2019 by avibootz

Related questions

3 answers 425 views
2 answers 309 views
309 views asked Apr 11, 2019 by avibootz
1 answer 247 views
247 views asked Jun 12, 2019 by avibootz
1 answer 246 views
...