fork download
  1. def multipliers():
  2.  
  3. return [lambda x: i * x for i in range(4)]
  4.  
  5. print [m(2) for m in multipliers()]
Success #stdin #stdout 0.02s 7092KB
stdin
Standard input is empty
stdout
[6, 6, 6, 6]