def foo():
  x = 123
  return lambda y: x+y

q = foo()

print q(5)