Search⌘ K
AI Features

Challenge 5: Inheritance

Explore how to apply inheritance in Python by building a Square class that inherits from a Rectangle class. Understand how to call the parent constructor using super and implement class constructors effectively. This lesson helps you practice object-oriented programming fundamentals through a practical coding challenge involving class attributes and methods.

Problem Statement

The code for the Rectangle class is implemented below:

  1. Create a Square class as a ​subclass of Rectangle.

  2. Implement the ...