Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
import fractions solution in Clear category for Fractions Addition by Olpag
from fractions import Fraction
def add_fractions(fracts):
res = sum(Fraction(*frac) for frac in fracts)
return int(res) if res == int(res) else ('', f'{int(res)} and ')[res > 1] + f'{res - int(res)}'
March 13, 2020
Comments: