What is object-oriented programming, and what are the principles of object-oriented programming? What is the difference between a class and an object?
For the practical portion, implement a small object-oriented shape calculator. Define shape classes that encapsulate their dimensions and expose a common area() method, then return the area of each shape specification.
Use calculate_areas(shapes), where shapes is a list of dictionaries with either { "type": "rectangle", "width": w, "height": h } or { "type": "square", "side": s }. Return a list of numeric areas in the same order.
def calculate_areas(shapes):