]> Untitled Git - axy/ft/python00.git/commitdiff
Finished this dumb subject
authorAxy <gilliardmarthey.axel@gmail.com>
Mon, 29 Dec 2025 16:17:02 +0000 (17:17 +0100)
committerAxy <gilliardmarthey.axel@gmail.com>
Mon, 29 Dec 2025 16:17:02 +0000 (17:17 +0100)
.gitignore [new file with mode: 0644]
ex0/ft_hello_garden.py [new file with mode: 0644]
ex1/ft_plot_area.py [new file with mode: 0644]
ex2/ft_harvest_total.py [new file with mode: 0644]
ex3/ft_plant_age.py [new file with mode: 0644]
ex4/ft_water_reminder.py [new file with mode: 0644]
ex5/ft_count_harvest_iterative.py [new file with mode: 0644]
ex5/ft_count_harvest_recursive.py [new file with mode: 0644]
ex6/ft_garden_summary.py [new file with mode: 0644]
ex7/ft_seed_inventory.py [new file with mode: 0644]

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..5d72cc3
--- /dev/null
@@ -0,0 +1,2 @@
+**__pycache__
+**main.py
diff --git a/ex0/ft_hello_garden.py b/ex0/ft_hello_garden.py
new file mode 100644 (file)
index 0000000..9885c07
--- /dev/null
@@ -0,0 +1,2 @@
+def ft_hello_garden():
+    print("Hello, Garden Community!")
diff --git a/ex1/ft_plot_area.py b/ex1/ft_plot_area.py
new file mode 100644 (file)
index 0000000..8144b21
--- /dev/null
@@ -0,0 +1,4 @@
+def ft_plot_area():
+    length: int = int(input("Enter length: "))
+    width: int = int(input("Enter width: "))
+    print(f"Plot area: {length * width}")
diff --git a/ex2/ft_harvest_total.py b/ex2/ft_harvest_total.py
new file mode 100644 (file)
index 0000000..3508778
--- /dev/null
@@ -0,0 +1,5 @@
+def ft_harvest_total():
+    day1: int = int(input("Day 1 harvest: "))
+    day2: int = int(input("Day 2 harvest: "))
+    day3: int = int(input("Day 3 harvest: "))
+    print(f"Total harvest: {day1 + day2 + day3}")
diff --git a/ex3/ft_plant_age.py b/ex3/ft_plant_age.py
new file mode 100644 (file)
index 0000000..9c3e0be
--- /dev/null
@@ -0,0 +1,6 @@
+def ft_plant_age():
+    age: int = int(input("Enter plant age in days: "))
+    if age > 60:
+        print("Plant is ready to harvest!")
+    else:
+        print("Plant needs more time to grow.")
diff --git a/ex4/ft_water_reminder.py b/ex4/ft_water_reminder.py
new file mode 100644 (file)
index 0000000..d3490c0
--- /dev/null
@@ -0,0 +1,6 @@
+def ft_water_reminder():
+    days: int = int(input("Days since last watering: "))
+    if days > 2:
+        print("Water the plants")
+    else:
+        print("Plants are fine")
diff --git a/ex5/ft_count_harvest_iterative.py b/ex5/ft_count_harvest_iterative.py
new file mode 100644 (file)
index 0000000..40b5560
--- /dev/null
@@ -0,0 +1,5 @@
+def ft_count_harvest_iterative():
+    days: int = int(input("Days until harvest: "))
+    for day in range(1, days):
+        print(f"Day {day}")
+    print("Harvest time!")
diff --git a/ex5/ft_count_harvest_recursive.py b/ex5/ft_count_harvest_recursive.py
new file mode 100644 (file)
index 0000000..90f2602
--- /dev/null
@@ -0,0 +1,10 @@
+def ft_count_harvest_recursive_in(day: int, days: int):
+    if day <= days:
+        print(f"Day {day}")
+        ft_count_harvest_recursive_in(day + 1, days)
+
+
+def ft_count_harvest_recursive():
+    days: int = int(input("Days until harvest: "))
+    ft_count_harvest_recursive_in(1, days)
+    print("Harvest time!")
diff --git a/ex6/ft_garden_summary.py b/ex6/ft_garden_summary.py
new file mode 100644 (file)
index 0000000..0498ff1
--- /dev/null
@@ -0,0 +1,6 @@
+def ft_garden_summary():
+    name = input("Enter garden name: ")
+    plants = input("Enter number of plants: ")
+    print(f"Garden: {name}")
+    print(f"Plants: {plants}")
+    print("Status: Growing well!")
diff --git a/ex7/ft_seed_inventory.py b/ex7/ft_seed_inventory.py
new file mode 100644 (file)
index 0000000..3fa7481
--- /dev/null
@@ -0,0 +1,10 @@
+def ft_seed_inventory(variety: str, quantity: int, unit: str):
+    prefix = f"{variety.capitalize()} seeds:"
+    if unit == "packets":
+        print(f"{prefix} {quantity} packets available")
+    elif unit == "grams":
+        print(f"{prefix} {quantity} grams total")
+    elif unit == "area":
+        print(f"{prefix} covers {quantity} quare meters")
+    else:
+        print("Unknown unit type")