object-oriented programming class vector """represent vector in multidimensional space "" def init (selfd) """create -dimensional vector of zeros "" self coords [ def len (self) """return the dimension of the vector "" return len(self coords def getitem (selfj) """return jth coordinate of vector "" return self coords[ def setitem (selfjval) """set jth coordinate of vector to given value "" self coords[jval def add (selfother) """return sum of two vectors "" if len(self!len(other)relies on len method raise valueerrordimensions must agree result vector(len(self)start with vector of zeros for in range(len(self)) result[jself[jother[ return result def eq (selfother) """return true if vector has same coordinates as other "" return self coords =other coords def ne (selfother) """return true if vector differs from other "" return not self =other rely on existing eq definition def str (self) """produce string representation of vector ""adapt list representation return code fragment definition of simple vector class