push
This commit is contained in:
+1
@@ -0,0 +1 @@
|
||||
print("Hello, Garden Community!")
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
def ft_plot_area():
|
||||
lenght = int(input("Enter length: "))
|
||||
widht = int(input("Enter Widht: "))
|
||||
print("Plot area:", lenght * widht)
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
def ft_harvest_total():
|
||||
day = int(input("Day 1 harvest: "))
|
||||
day += int(input("Day 2 harvest: "))
|
||||
day += int(input("Day 3 harvest: "))
|
||||
print("Total harvest:", day)
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
def ft_plant_age():
|
||||
age = int(input("Enter plant age in days: "))
|
||||
if age > 60:
|
||||
print("Plant is ready to harvest!")
|
||||
else:
|
||||
print("Plant needs more time to grow.")
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
def ft_water_reminder():
|
||||
day = int(input("Days since last watering: "))
|
||||
if day > 2:
|
||||
print("Water the plants!")
|
||||
else:
|
||||
print("Plants are fine")
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
def ft_count_harvest_iterative():
|
||||
day = int(input("Days until harvest: "))
|
||||
while day > 0:
|
||||
print("Day", 5 - day + 1)
|
||||
day = day - 1
|
||||
print("Harvest time!")
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
def ft_count_harvest_recursive(day=None, last=None):
|
||||
if day is None and last is None:
|
||||
last = int(input("Days until harvest: "))
|
||||
day = 1
|
||||
if day > last:
|
||||
print("Harvest time!")
|
||||
return
|
||||
print("Day", day)
|
||||
ft_count_harvest_recursive(day + 1, last)
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
def ft_garden_summary():
|
||||
name = input("Enter garden name: ")
|
||||
number = input("Enter number of plants: ")
|
||||
print("Garden:", name, "\nPlants:", number, "\nStatus: Growing Well!")
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
def ft_seed_inventory(seed_type: str, quantity: int, unit: str) -> None:
|
||||
seed_type = seed_type.lower()
|
||||
seed_type = seed_type[0].upper() + seed_type[1:]
|
||||
if unit == "packets":
|
||||
print(seed_type, "seeds:", quantity, unit, "available")
|
||||
elif unit == "grams":
|
||||
print(seed_type, "seeds:", quantity, unit, "total")
|
||||
elif unit == "area":
|
||||
print(seed_type, "seeds: covers", quantity, "square meters")
|
||||
else:
|
||||
print("Unknown unit type")
|
||||
Reference in New Issue
Block a user