any() and all()
any is True if at least one item is truthy; all is True if every item is (True for empty).
Beginner
all(v < 5.5 for v in voltages)
any(r.failed for r in results)
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.