Guest User

Untitled

a guest
Apr 20th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.11 KB | None | 0 0
  1. def multipliers():
  2. for i in range(4):
  3. yield lambda x: i*x
  4.  
  5. print([m(2) for m in multipliers()])
  6.  
  7. # [0, 2, 4, 6]
Add Comment
Please, Sign In to add comment