Advertisement
Taigar2000

E

Nov 14th, 2020
649
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.48 KB | None | 0 0
  1. from sys import stdin
  2.  
  3.  
  4. class Matrix:
  5.     def __init__(self, arr):
  6.         self.a = []
  7.         for i in arr:
  8.             self.a.append([])
  9.             for j in i:
  10.                 self.a[-1].append(j)
  11.  
  12.     def __str__(self):
  13.         res = ''
  14.         for i in self.a:
  15.             for j in i:
  16.                 res += str(j) + '\t'
  17.             res = res[:-1] + '\n'
  18.         return res[:-1]
  19.  
  20.     def size(self):
  21.         return (len(self.a), len(self.a[0]))
  22.  
  23. exec(stdin.read())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement