Guest User

Untitled

a guest
Oct 21st, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.15 KB | None | 0 0
  1. f = add_functions(lambda x: x*2, lambda x: x + 1)
  2.  
  3. f(2) # returns (2*2) + (2 + 1) = 7
  4.  
  5. def add_functions(f, g):
  6. return lambda x: f(x) + g(x)
Add Comment
Please, Sign In to add comment