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

0

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

+1

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 https://code.sololearn.com/ciOl7W4tds18 and look at the last segment, you can use it to check if any of the items matches your filter.

0

Yes Sure, using filter without condition is meaningless, because it will iterate on all list items like map does. check this code: https://code.sololearn.com/cNmhCfMXggAP/#py