Бельницкая Елизавета Алексеевна 321 DummyVec 11093
Куклин Михаил Игоревич 524 DummyVec 10618
f1class vector:f1class vector:
22
n3    def __init__(self, values):n3    def __init__(self, iterable):
4        self.values = list(values)4        self.data = list(iterable)
55
6    def __str__(self):6    def __str__(self):
n7        return ':'.join(map(str, self.values))n7        return ':'.join(map(str, self.data))
88
9    def __add__(self, other):9    def __add__(self, other):
n10        return vector((v1 + v2 for v1v2 in zip(self.values, other)))n10        return vector([x + y for xy in zip(self.data, other)])
1111
12    def __radd__(self, other):12    def __radd__(self, other):
13        return self.__add__(other)13        return self.__add__(other)
1414
15    def __matmul__(self, other):15    def __matmul__(self, other):
n16        return sum((v1 * v2 for v1v2 in zip(self.values, other)))n16        return sum([x * y for xy in zip(self.data, other)])
1717
18    def __getitem__(self, index):18    def __getitem__(self, index):
t19        return self.values[index]t19        return self.data[index]
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op