Sort by

recency

|

201 Discussions

|

  • + 0 comments
    from fractions import Fraction
    from functools import reduce
    def product(fracs):
        t = reduce(lambda x, y: x*y, fracs)
        return t.numerator, t.denominator
    if __name__ == '__main__':
        fracs = []
        for _ in range(int(input())):
            fracs.append(Fraction(*map(int, input().split())))
        result = product(fracs)
        print(*result)
    
  • + 0 comments
    from fractions import Fraction
    from functools import reduce
    from operator import mul
    
    def product(fracs):
        t = reduce(mul, fracs)
        return t.numerator, t.denominator
    
    if __name__ == '__main__':
        fracs = []
        for _ in range(int(input())):
            fracs.append(Fraction(*map(int, input().split())))
        result = product(fracs)
        print(*result)
    
  • + 0 comments
    from fractions import Fraction
    from functools import reduce
    
    def product(fracs):
        t = reduce(lambda x, y: x*y, fracs)  # complete this line with a reduce statement
        return t.numerator, t.denominator
    
    if __name__ == '__main__':
        fracs = []
        for _ in range(int(input())):
            fracs.append(Fraction(*map(int, input().split())))
        result = product(fracs)
        print(*result)
    
  • + 0 comments
    def product(fracs):
        t = reduce(lambda x, y : x * y, fracs)
        return t.numerator, t.denominator
    
  • [deleted]
    + 0 comments
    def product(fracs):
        t = reduce(lambda x, y: x*y, fracs)  # complete this line with a reduce statement
        return t.numerator, t.denominator