If a have a list like:
l = [1,2,3,4,5]
and I want to have at the end
min = 1 max = 5
WITHOUT
>>> L = [1,2,3,4,5] >>> reduce(lambda x, y: x if x>> reduce(lambda x, y: x if x>y else y, L) 5
Another way
>>> it = iter(L) >>> mn = mx = next(it) >>> for i in it: ... if imx:mx=i ... >>> mn 1 >>> mx 5