10월 4, 2016의 게시물 표시

python2 class 리스트,매트릭스 멤버간 합

class aaaa:         def __init__(self,x):                 self.x =x         def __myadd__(self,other):                 z = self.x+other                 return z         def __addlst__(self,lst):                 for i in range(0,len(self.x)):                         self.x[i] = self.x[i] + lst[i]                 return self.x         def __addmatrix__(self,mat):                 for i in range(0,len(self.x)):                         for j in range(0,len(self.x[i])):                       ...