1234567891011121314151617181920212223242526272829303132 |
- class Matrix(object):
- """
- Represents a matrix
- """
- def __init__(self, matrix=None):
- """
- """
-
- self.mat = matrix
-
-
- def __getitem__(self, index):
- """
- """
-
- return self.mat[index[0]][index[1]]
-
- def __setitem__(self, index, item):
- """
- """
- self.mat[index[0]][index[1]] = item
- trial=Matrix([[543]])
- trial[0,0]=100
- print trial[0,0]
|