Skip to content

Instantly share code, notes, and snippets.

@Deep18-03
Created April 25, 2020 15:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Deep18-03/8c823dd5ba3c8b6de43a8aa455fa4d4d to your computer and use it in GitHub Desktop.
Save Deep18-03/8c823dd5ba3c8b6de43a8aa455fa4d4d to your computer and use it in GitHub Desktop.
#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