Articles → Python → Filter function in python

Filter function in python






Purpose





Syntax


filter(function, collection)



Example




mylist = [1,2,3,4,5]

print(list(filter(lambda num: num %2==0,mylist)))





Click to Enlarge


Posted By  -  Karan Gupta
 
Posted On  -  Wednesday, March 13, 2019

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250