I used two for loops for this and i stuck in here;
size = int(input("size? : "))
matrix = list(range(size**2))
for i in range(size):
for j in range(size):
print(j, end=" ")
print()
and my output is;
size? : 3
0 1 2
0 1 2
0 1 2
How can I make it look like;
0 1 2
3 4 5
6 7 8
But it has to be work for any number that i gave