BeginnerCoder

Lesson 10 — any and all

Quick checks

any is True if at least one item is truthy; all if every item is. Both accept a generator like (n > 0 for n in nums).

Why it matters: they replace long loops for validation.

Want it another way?
Task

Print True if all numbers are positive.

Run your code — when the output matches the task, you will see a green check. Then mark the lesson complete.

← Back
Next →
Test your knowledge

A quick 3-question quiz on this lesson — instant feedback.

Enjoying this lesson? Share it.