I am just starting to learn python and was looking for a solution to build a multi-dimensional list. I want to understand how it works.
Code:
And also, how does the way this (below code) is written actually creates the output? Is this just built into the language?
Code:
Any help will be appreciated!
Code:
>>> list = [[0 for x in range(4)] for x in range(4)]
And also, how does the way this (below code) is written actually creates the output? Is this just built into the language?
Code:
[[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]
Any help will be appreciated!