0
My teacher gave this snippet for Accepting input from user and creating a matrix using list.
I am not able to understand the row and column part here. can a sample matrix be generated so that I can understand how the matrix will look? r,c=3,2 x=[] for i in range(r): x.append([0]*c) for i1 in range(r): for i2 in range(c): x[i1][i2]=int(input()) print()
2 Respostas
+ 7
[[x00, x01], ← columns = 2
[x10, x11],
[x20, x21]]
↑rows = 3
+ 2
You can use print(x) to see what values are saved in the matrix.