Skip to content

Instantly share code, notes, and snippets.

@xordoquy
Last active August 29, 2015 14:10
Show Gist options
  • Save xordoquy/ec7d064611598d558115 to your computer and use it in GitHub Desktop.
Save xordoquy/ec7d064611598d558115 to your computer and use it in GitHub Desktop.
result = []
for i in range(5):
def f():
print(i)
result.append(f)
for f in result:
f()
# Result:
4
4
4
4
4
# Expected:
0
1
2
3
4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment