The Python Oracle

How to check if all elements of a list match a condition?

Become part of the top 3% of the developers by applying to Toptal https://topt.al/25cXVn

--

Music by Eric Matyas
https://www.soundimage.org
Track title: Over a Mysterious Island

--

Chapters
00:00 Question
01:34 Accepted answer (Score 534)
02:43 Answer 2 (Score 27)
03:07 Answer 3 (Score 8)
03:27 Answer 4 (Score 1)
03:49 Thank you

--

Full question
https://stackoverflow.com/questions/1066...

Accepted answer links:
[all()]: http://docs.python.org/library/functions...
[generator expression]: https://www.youtube.com/watch?
[any()]: http://docs.python.org/library/functions...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#python #list #forloop #whileloop

#avk47