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 293 views
2 answers 209 views
209 views asked Apr 11, 2019 by avibootz
1 answer 185 views
185 views asked Jun 12, 2019 by avibootz
1 answer 150 views
...