one-liner reduce in Python3
In Python3, I am looking for a way to compute in one line a lambda function called on elements two by two. Let’s say I want to compute the LCM of a list of integers, this can be done in one line in Python2 : print reduce(lambda a,b: a * b // gcd(a, b), mylist) Is it possible to do the same in one line Python3 (implied, without functools.reduce )? In Python3 I know that filter , map and reduce are gone. I don’t feel I need filter and map anymore because they can be written in Python3 in a shorter and more clear fashion but I thought I could find a nice replacement for reduce as well, except I