Skip to content
UPEEC

sum(), min() and max()

Aggregate an iterable; min/max accept key= and default=.

Beginner
Comments 0
sum(currents)
max(parts, key=lambda p: p.rating)
min([], default=0)

Spotted a mistake or want to add detail? Suggest an improvement — Content Contributors' edits are reviewed by editors before they go live.

Discussion (0)

Sign in or join free to ask questions and discuss this topic.