@@ -0,0 +1,1105 @@
+class Coordinate(object):%0A    def __init__(self, x, y):%0A        self.x = x%0A        self.y = y%0A    def __str__(self):%0A        return %22%3C%7B%7D, %7B%7D%3E%22.format(self.x, self.y)%0A        %0A    def getX(self):%0A        #Getter method for a Coordinate object's x coordinate.%0A        #Getter methods are better practice than just accessing an %0A        #   attribute directly%0A        return self.x%0A        %0A    def getY(self):%0A        return self.y%0A      %0A    def __eq__(self, other):%0A        #first make sure they are of the same type%0A        assert type(other) == type(self)%0A        #return self.getX == other.getX and self.getY == other.getY%0A        return self.x == other.x and self.y == other.y%0A           %0A    def __repr__(self):%0A        return 'Coordinate(' + str(self.getX()) + ', ' +str(self.getY()) + ')'%0A    %0A    def distance(self, other):%0A        import math%0A        return math.sqrt((self.x - other.x)**2 + (self.y - other.y)**2)%0A        %0Ac = Coordinate(4, 7)%0Aprint c.x, c.y%0A%0Aorigin = Coordinate(34, 95)%0Aprint origin.x, origin.y%0A%0Aisinstance(c, Coordinate)%0A%0Ac.distance(origin) #using a method with two instances%0A

Add Coordinate class practice