Here is what I did-
grid_len = input("Enter Grid Length: ") #Assuming grid_length to be 3
s = []
while True:
s.append(input())
if len(s) == int(grid_len)**2: #grid_length^2 will be 9
print(s)
break
When Input is for example 1 in the first loop, 2 in the second, 3 in the third and so on upto 9; It creates a list like this:
['1','2','3','4','5','6','7','8','9']
But I want it something like this:
[[1,2,3],[4,5,6],[7,8,9]]