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.
We'll cover the following...
We'll cover the following...
Problem Statement
The code for the Rectangle class is implemented below:
-
Create a
Squareclass as a subclass ofRectangle. -
Implement the ...