Advertisement
Guest User

Untitled

a guest
Apr 4th, 2020
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.37 KB | None | 0 0
  1. with open(filepath) as fp:
  2.      line = int(fp.readline())
  3.      for i in range(0, line):
  4.          size = int(fp.readline())
  5.          matrix = []
  6.          for j in range(0, size):
  7.               row = fp.readline()
  8.               row = row.split() # split in every space
  9.               row = [int(x) for x in row]
  10.               matrix.append(row)
  11.          print(matrix)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement