This commit is contained in:
lfirmin
2026-01-07 21:42:11 +01:00
parent d02ef5f88a
commit 11040c45b8
25 changed files with 572 additions and 3 deletions
@@ -0,0 +1,22 @@
class Plant:
def __init__(self, name, height, age):
self.name = name
self.height = height
self.age = age
plant_data = [
("Rose", 25, 30),
("Oak", 200, 365),
("Cactus", 5, 90),
("Sunflower", 80, 45),
("Fern", 15, 120)
]
index = 0
plants = [Plant(name, height, age) for name, height, age in plant_data]
for p in plants:
print(f"Created: {p.name} ({p.height} cm, {p.age} days)")
index += 1
print(f"\nTotal plants created: {index}")