Skip to content

Instantly share code, notes, and snippets.

@danetrata
Created December 24, 2016 14:48
Show Gist options
  • Save danetrata/ac87de1f9318ff9cb6184935d4d6f242 to your computer and use it in GitHub Desktop.
Save danetrata/ac87de1f9318ff9cb6184935d4d6f242 to your computer and use it in GitHub Desktop.
n = 4
p = [lambda x: x**2 for _ in range(n)]
for i, pc in enumerate(p):
print pc(i)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment