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 436 views
2 answers 321 views
321 views asked Apr 11, 2019 by avibootz
1 answer 255 views
255 views asked Jun 12, 2019 by avibootz
1 answer 255 views
...