class Vector:
def __init__(self, x, y):
self.x = float(x)
self.y = float(y)
def __str__(self):
return str(tuple(self))
def __iter__(self):
return (i for i in (self.x, self.y))
def __add__(self, other):
pairs = map(sum, zip(self, other))
return Vector(*pairs)
v1 = Vector(2, 3)
v2 = Vector(5, 5)
print(v1 + v2) # (7.0, 8.0)