Any condition for filter? | SoloLearn: Learn to code for FREE!


Any condition for filter?

Shall we use any condition to filter out values from the list?

10/21/2016 7:43:26 AM

Kiran K L

2 Answers

New Answer


Yes, but know that whichever condition you use must at least be true for at least one of the items in an iterable. Check out this code and look at the last segment, you can use it to check if any of the items matches your filter.


Yes Sure, using filter without condition is meaningless, because it will iterate on all list items like map does. check this code: