class Point(object):
"""Represents a point in 2-D space."""
class Rectangle(object):
"""Represents a rectangle
attributes: width, height, corner.
"""
def create_rectangle(x, y, width, height):
pt = Point()
pt.x = x
pt.y = y
r = Rectangle()
r.width = width
r.height = height
r.corner = pt
return r
def area_difference(r1, r2):
area1 = r1.width * r1.height
area2 = r2.width * r2.height
return area1 - area2
r1 = create_rectangle(10, 20, 10, 10)
r2 = create_rectangle(20, 50, 15, 20)
print(area_difference(r1, r2))