| f | class vector: | f | class vector: | 
            |  |  |  |  | 
            | n | def __init__(self, values): | n | def __init__(self, iterable): | 
            |  | self.values = list(values) |  | self.data = list(iterable) | 
            |  |  |  |  | 
            |  | def __str__(self): |  | def __str__(self): | 
            | n | return ':'.join(map(str, self.values)) | n | return ':'.join(map(str, self.data)) | 
            |  |  |  |  | 
            |  | def __add__(self, other): |  | def __add__(self, other): | 
            | n | return vector((v1 + v2 for v1, v2 in zip(self.values, other))) | n | return vector([x + y for x, y in zip(self.data, other)]) | 
            |  |  |  |  | 
            |  | def __radd__(self, other): |  | def __radd__(self, other): | 
            |  | return self.__add__(other) |  | return self.__add__(other) | 
            |  |  |  |  | 
            |  | def __matmul__(self, other): |  | def __matmul__(self, other): | 
            | n | return sum((v1 * v2 for v1, v2 in zip(self.values, other))) | n | return sum([x * y for x, y in zip(self.data, other)]) | 
            |  |  |  |  | 
            |  | def __getitem__(self, index): |  | def __getitem__(self, index): | 
            | t | return self.values[index] | t | return self.data[index] |