Skip to content

Instantly share code, notes, and snippets.

@vexorian
Created May 20, 2015 05:40
Show Gist options
  • Save vexorian/b862c982b3b2741ef0d1 to your computer and use it in GitHub Desktop.
Save vexorian/b862c982b3b2741ef0d1 to your computer and use it in GitHub Desktop.
Solution to first problem
f = [] * 3
for i in range(3):
f[i] = sum
i = 0
while i < 3:
f[i] = sum
i += 1
def doIt(i):
if i == 100:
return [ sum for x in range(3) ]
else:
return doIt(i + 1)
f = doIt(0)
# Now f[0], f[1] and f[2] are functions that sum all elements in list!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment