Created
April 25, 2020 15:48
-
-
Save Deep18-03/8c823dd5ba3c8b6de43a8aa455fa4d4d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#map,filter,reduce | |
#filter | |
def greater_than5(num): | |
"""this is fun which find the number which is greather than 5""" | |
return num>4 | |
def even(num): | |
"""this function will return the even number""" | |
return num%2==0 | |
if __name__ == '__main__': | |
lst=[2,3,4,5,6,7,8,9] | |
print(greater_than5.__doc__) | |
val=list(filter(greater_than5,lst)) | |
print(even.__doc__) | |
val=list(filter(even,lst)) | |
print(val) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment