Advertisement
Guest User

Untitled

a guest
Oct 21st, 2016
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.41 KB | None | 0 0
  1. #from sys import stdin
  2.  
  3.  
  4. class Matrix:
  5.     def __init__(self, lines):
  6.         self.lines = []
  7.         for line in lines:
  8.             lines.append(line.copy())
  9.  
  10.     def __str__(self):
  11.         s = '\n'.join(map(lambda line: '\t'.join(map(str, line)), self.lines))
  12.         return s
  13.  
  14. m1 = Matrix([[1, 0, 0], [1, 1, 1], [0, 0, 0]])
  15. m2 = Matrix([[1, 0, 0], [1, 1, 1], [0, 0, 0]])
  16. print(str(m1) == str(m2))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement