ppe2/src/codewars/kata_thinkful_vectors.py

8 lines
185 B
Python

class Vector(object):
def __init__(self, x: int, y: int):
self.x = x
self.y = y
def add(self, other):
return Vector(self.x + other.x, self.y + other.y)