Project Brief
Today we will practice object-oriented programming. Imagine you are developing a civil engineering application (e.g., AutoCAD) with Python. Your current task is to create a Python class that represents a rectangle geometrical figure. The Rectangle class should:
Two instance attributes, width, and height.
An area() method that returns the area of the rectangle.
A perimeter() method that returns the perimeter of the rectangle.
An is_square() method that returns True if the rectangle is a square and False (or None) if it is not.
Expected Output
Your task is to simply define the class. You don’t need to call the class.
Environment Setup Instructions
You don’t need to install any libraries.
Resources
Read about classes and OOP in this short tutorial:
https://pythonhow.com/what/classes-and-oop-explained/
Project Solution
Feel free to post your questions or comments in the comment section below.
Happy Coding!
Daily Python Projects Team