​python_modules /
module-01 / ex1 / ft_garden_data.py
106 commits
09-05-2026
26 lines 566 B
 1class Plant:
 2    def __init__(self, name: str, height: int, age: int) -> None:
 3        self.name = name
 4        self.height = height
 5        self.age = age
 6
 7    def show(self) -> None:
 8        print(f"{self.name}: {self.height}cm, {self.age} days old")
 9
10
11def main() -> None:
12    print("=== Garden Plant Registry ===")
13
14    plant1 = Plant("Rose", 25, 30)
15    plant2 = Plant("Sunflower", 80, 45)
16    plant3 = Plant("Cactus", 15, 120)
17
18    plant1.show()
19    plant2.show()
20    plant3.show()
21
22    print("\n=== End of Program ===")
23
24
25if __name__ == "__main__":
26    main()