Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

🌿 Python Module 01 — Object-Oriented Garden Systems

This project is part of the 42 School Common Core and focuses on Object-Oriented Programming (OOP) in Python.

Building on the fundamentals learned in Module 00, this module introduces more structured and scalable programming concepts through the creation of a digital garden ecosystem.

The goal of this module is to understand and apply:

  • classes and objects
  • instance methods
  • class methods and static methods
  • encapsulation and data protection
  • inheritance and class hierarchies
  • code organization and reuse
  • nested helper classes
  • basic system design and architecture

Each exercise incrementally builds on the previous one, resulting in a cohesive and extensible system by the end of the module.


📁 Project Structure

Each exercise is placed in its own directory (ex0 to ex6) and contains only the files requested by the subject.

📌 Exercises Overview

Exercise 0 — Planting Your First Seed

Introduces Python program structure and execution.

  • Uses if __name__ == "__main__"
  • Stores basic plant data
  • Prints formatted output

Concepts: program entry point, variables, execution flow


Exercise 1 — Garden Data Organizer

Introduces the first class-based design.

  • Creates a Plant class
  • Stores name, height, and age
  • Manages multiple plant instances

Concepts: classes, objects, attributes


Exercise 2 — Plant Growth Simulator

Adds behavior to plants.

  • Reuses the Plant class
  • Implements growth and aging
  • Simulates changes over time

Concepts: instance methods, state changes


Exercise 3 — Plant Factory

Focuses on object creation.

  • Creates multiple plants efficiently
  • Uses constructors (__init__)
  • Displays structured output

Concepts: object initialization, reuse


Exercise 4 — Garden Security System

Introduces data protection.

  • Implements SecurePlant
  • Protects data using validation
  • Uses getters and setters

Concepts: encapsulation, data integrity


Exercise 5 — Specialized Plant Types

Introduces inheritance.

  • Base Plant class
  • Specialized plant types
  • Uses super() to reuse code

Concepts: inheritance, polymorphism


Exercise 6 — Garden Analytics Platform

Combines all module concepts.

  • Manages multiple gardens
  • Uses a nested statistics helper
  • Implements a plant hierarchy
  • Calculates statistics and scores

Concepts: system design, nested classes, method types


✅ Notes

  • Written for Python 3.10+
  • Fully compliant with flake8
  • Follows 42 naming conventions
  • Outputs match the subject examples exactly