Skip to content

Instantly share code, notes, and snippets.

@reeddunkle
Last active May 2, 2016 18:56
Show Gist options
  • Select an option

  • Save reeddunkle/58e2d9bdb7b41cd3cb796d362964e64c to your computer and use it in GitHub Desktop.

Select an option

Save reeddunkle/58e2d9bdb7b41cd3cb796d362964e64c to your computer and use it in GitHub Desktop.
Custom Filter Method
def my_filter(function, iterable):
output = []
for item in iterable:
if function(item):
output.append(item)
return output
numbers = range(1, 100)
print(my_filter(lambda x: x % 2 == 0, numbers))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment