14 Jan Monday 17:30 Python Practice – 23.01.09.
Question:
- Write a Rectangle class in Python language, allowing you to build a rectangle with length and width attributes.
- Create a Perimeter() method to calculate the perimeter of the rectangle and a Area() method to calculate the area of the rectangle.
- Create a method display() that display the length, width, perimeter and area of an object created using an instantiation on rectangle class.
- Create a Cuboid child class inheriting from the Rectangle class and with a height attribute and another Volume() method to calculate the volume of the Cuboid.
Sorry, the comment form is closed at this time.