Skip to content

Instantly share code, notes, and snippets.

@ysnerdem
Created January 17, 2018 23:41
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 ysnerdem/ed7b49c0a3fc6764fc231af92f842afb to your computer and use it in GitHub Desktop.
Save ysnerdem/ed7b49c0a3fc6764fc231af92f842afb to your computer and use it in GitHub Desktop.
from functools import reduce
even = list(filter(lambda x: x % 2 == 0, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]))
print(reduce(lambda x, y: x + y, even))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment