Created
June 25, 2017 21:13
-
-
Save le-dawg/d354551f18e9cc18c6fd5beeb2c64500 to your computer and use it in GitHub Desktop.
Easily initialize 2D list
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
# Rapidly initalize 2D list | |
2dlist = [[0] * 3 for i in xrange(3)] | |
print(2dlist) | |
# [[0, 0, 0], [0, 0, 0], [0, 0, 0]] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment