peak(requests_per_minute) returning the maximum value in a non-empty list using functools.reduce and a lambda — max() on the whole list is banned (the lambda may compare two values however you like).peak([120, 450, 300])
450
reduce keeps the larger of each pair.
The accumulator carries the best-so-far.
lambda a, b: a if a > b else b.