def __rmul__(self, num):
    return self.__mul__(num)

def length(self):
    return self.x ** 2 + self.y ** 2
x = Point(1, 2)
y = Point(1, 3)
print(x + y)
print(y + x)
print(x - y)
print(y - x)
print(y * 3)
print(3 * y)
Overiding __mul__ in two dimensional vector class to preserve commutivity