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 428 views
2 answers 315 views
315 views asked Apr 11, 2019 by avibootz
1 answer 250 views
250 views asked Jun 12, 2019 by avibootz
1 answer 249 views
...