Skip to content

Latest commit

 

History

History

python-more_classes

README.md for Python - More Classes and Objects Project

Overview

This project focuses on deepening understanding of Object-Oriented Programming (OOP) in Python, emphasizing the creation and manipulation of classes and objects. It explores advanced topics like class vs. instance attributes, method types (classmethods and staticmethods), property decorators, and special methods like __str__ and __repr__.

Learning Objectives

  • Grasp the essence of OOP, class, object, and instance differences.
  • Understand attributes and methods, including special methods like __init__.
  • Master data encapsulation, abstraction, and information hiding.
  • Distinguish between class and object attributes.
  • Utilize property decorators for data encapsulation.
  • Learn to create and use class methods and static methods.

Requirements

  • Python 3.8.5
  • Compliance with PEP 8 style guidelines.
  • Documentation for each module, class, and method.

Project Tasks

  1. Simple Rectangle: Define an empty Rectangle class.
  2. Real Definition of a Rectangle: Enhance Rectangle with width and height.
  3. Area and Perimeter: Implement area and perimeter methods.
  4. String Representation: Define how a Rectangle is represented as a string.
  5. Detect Instance Deletion: Customize behavior for instance deletion.
  6. Number of Instances: Track the number of Rectangle instances.
  7. Change Representation: Modify string representation dynamically.
  8. Compare Rectangles: Add static method to compare rectangles.
  9. A Square is a Rectangle: Implement a square as a type of rectangle.

Conclusion

This project provides a comprehensive understanding of advanced OOP concepts in Python, laying a solid foundation for more complex programming tasks involving classes and objects.

Note: For detailed implementation and project files, refer to the GitHub Repository.