Last active
August 29, 2015 14:20
-
-
Save mu-777/f0c9c8554c15edb15660 to your computer and use it in GitHub Desktop.
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
MAT_SIZE = 3 | |
mat = [[0 for i in range(MAT_SIZE)] for j in range(MAT_SIZE)] | |
# >>> mat | |
# [[0, 0, 0], [0, 0, 0], [0, 0, 0]] | |
for i, j in [(i, j) for i in range(MAT_SIZE) for j in range(MAT_SIZE)]: | |
mat[i][j] = 10*i + j | |
# >>> mat | |
# [[0, 1, 2], [10, 11, 12], [20, 21, 22]] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment