fork(1) download
  1. def read_lines():
  2. try:
  3. line = input()
  4. while line:
  5. yield line
  6. line = input()
  7. except EOFError:
  8. pass
  9.  
  10. def read_matrix():
  11. return [[int(x) for x in line.split()] for line in read_lines()]
  12.  
  13. a = read_matrix()
  14. print(a)
  15.  
  16. b = read_matrix()
  17. print(b)
Success #stdin #stdout 0.02s 9268KB
stdin
1 2 3
4 5 6

7 8
9 0
1 2
stdout
[[1, 2, 3], [4, 5, 6]]
[[7, 8], [9, 0], [1, 2]]