I'm trying to create a nxn 2D list where its values starts from 0 to n
something like this
[ 1 2 3 4 ]
[ 5 6 7 8 ]
[ 9 10 11 12]
I tried to use the following code to do it
self.board = [[list(range(n*n) for i in range(self.n)] for num in range(self.n)]
but instead it fills every element in the list with 16 elements
What expression should I use to replace list(range(n*n)) ?