Daily Python Projects

Daily Python Projects

Share this post

Daily Python Projects
Daily Python Projects
Create a Rectangle class (OOP)

Create a Rectangle class (OOP)

Level: Real-World

May 16, 2024
∙ Paid
3

Share this post

Daily Python Projects
Daily Python Projects
Create a Rectangle class (OOP)
Share

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

This post is for paid subscribers

Already a paid subscriber? Sign in
© 2025 Ardit Sulce
Privacy ∙ Terms ∙ Collection notice
Start writingGet the app
Substack is the home for great culture

Share