initializing a 2d array in python
I want to initialize an array like this: [[0,0],[0,0],...x]
|
|
This way seem like it works, but the sub-array is only referenced. If you try to append to a sub array:
|
|
Every sub-array get’s appended to since they’re only references to one array.
|
|
This is the proper way to do it. Every sub-array is a it’s own instance.