Skip to content

Instantly share code, notes, and snippets.

@cagedmantis
Created August 4, 2018 14:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cagedmantis/b8f527732c2c85776723a794c5e94087 to your computer and use it in GitHub Desktop.
Save cagedmantis/b8f527732c2c85776723a794c5e94087 to your computer and use it in GitHub Desktop.
append to a list in python
d = {"foo":[]}
for num in range(10):
for key, value in d.iteritems():
value.append(num)
d["foo"].append(23)
print d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment