Advertisement
mhdew

2d list

Oct 10th, 2020
1,048
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.46 KB | None | 0 0
  1. lst2=[]     #list to store entire row
  2.  
  3. for i in range(5):
  4.     lst1=[]     #list to store each element of a row
  5.     for i in range(5):
  6.         tmp=int(input())
  7.         lst1.append(tmp)       #incerting each elements of a row
  8.     lst2.append(lst1)           #incerting the entire row in another list
  9.  
  10. for i in range(len(lst2)):
  11.     for j in range(len(lst1)):
  12.         print(lst2[i][j],end=' ')       #i indicates row number and j indicates column number
  13.     print('')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement