Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
d and f'{d} and ' solution in Creative category for Fractions Addition by flpo
from fractions import Fraction
from itertools import starmap
def add_fractions(fs):
r = sum(starmap(Fraction, fs))
d, m = divmod(r.numerator, r.denominator)
return not m and d or (d and f'{d} and ' or '') + f'{r - d}'
April 25, 2018
Comments: