]> Untitled Git - axy/ft/python02.git/commitdiff
slop 2 electric boogaloo
author= <=>
Mon, 12 Jan 2026 11:59:01 +0000 (12:59 +0100)
committer= <=>
Mon, 12 Jan 2026 11:59:01 +0000 (12:59 +0100)
ex2/ft_custom_errors.py
ex5/ft_garden_management.py

index eb6cc452587a053be9298262c3778c5aeb507069..f3d283b35f76cb0cf8d15db0b1d10bdb830f0bf2 100644 (file)
@@ -29,12 +29,14 @@ def test_custom_errors() -> None:
         raise PlantError("tomato")
     except PlantError as e:
         print(f"Caught PlantError: {e}")
+    print()
 
     print("Testing WaterError...")
     try:
         raise WaterError()
     except WaterError as e:
         print(f"Caught WaterError: {e}")
+    print()
 
     print("Testing catching all garden errors...")
     try:
index 8aac568c90f5c0f6cbaa699dbfb37405aa3d08e6..024bf48c6a56bccd9780938dfd35cdb97cbfcee9 100644 (file)
@@ -143,18 +143,21 @@ def test_garden_management() -> None:
             print(f"Added {plant} successfully")
         except (ValueError, GardenError) as e:
             print(f"Error adding plant: {e}")
+    print()
 
-    print("\nWatering plants...")
+    print("Watering plants...")
     manager.water_plants(["tomato", "lettuce"])
+    print()
 
-    print("\nChecking plant health...")
+    print("Checking plant health...")
     for plant in ["tomato", "lettuce"]:
         try:
             manager.check_plant_health(plant)
         except GardenError as e:
             print(f"Error checking {plant}: {e}")
+    print()
 
-    print("\nTesting error recovery...")
+    print("Testing error recovery...")
     try:
         raise WaterError()
     except GardenError as e: