sum(), min() and max()
Aggregate an iterable; min/max accept key= and default=.
Beginner
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.