class Point:
    def __main__(self, x=0, y=0):
        self.x = x
        self.y = y

    def distance_from origin(self):
        return ((x ** 2) + (y ** 2)) ** 0.5

def distance_between_points(a, b):
    return distance_from_origin(a) - distance_from_origin(b)

I get a global variable error when I try to run the function at the bottom.

Your code is not anything that can really be corrected. Start with the "Defining Classes" and "Using Classes" Click Here and go on from there Post back once you have the basics down with any further questions.