I do not see any difference between takewhile and filter. Can someone help? | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 1

I do not see any difference between takewhile and filter. Can someone help?

I do not see any difference between takewhile and filter. Can someone help?

3rd Jul 2017, 11:06 AM
Rakesh
Rakesh - avatar
2 Réponses
+ 3
filter will work for the whole sequence whereas takewhile will work till the condition is true.
3rd Jul 2017, 11:08 AM
Sandesh
Sandesh - avatar