Skip to content

Instantly share code, notes, and snippets.

@ehermes
Created February 12, 2016 21:00
Show Gist options
  • Select an option

  • Save ehermes/e87ef054ad4eb9c342d8 to your computer and use it in GitHub Desktop.

Select an option

Save ehermes/e87ef054ad4eb9c342d8 to your computer and use it in GitHub Desktop.
def make_incrementors(start, amounts):
y = [start]
results = []
for x in amounts:
def add_x():
y[0] += x
return y[0]
results.append(add_x)
return results
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment