I tried to create this code to input an m by n matrix. I intended to input [[1,2,3],[4,5,6]] but the code yields [[4,5,6],[4,5,6]. Same things happ
[[1,2,3],[4,5,6]]
[[4,5,6],[4,5,6]
no_of_rows = 3 # For n by n, and even works for n by m but just give no of rows matrix = [[int(j) for j in input().split()] for i in range(n)] print(matrix)