Created
August 4, 2018 14:45
-
-
Save cagedmantis/b8f527732c2c85776723a794c5e94087 to your computer and use it in GitHub Desktop.
append to a list in python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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