summaryrefslogtreecommitdiff
path: root/py00/ex6/ft_count_harvest_recursive.py
diff options
context:
space:
mode:
Diffstat (limited to 'py00/ex6/ft_count_harvest_recursive.py')
-rw-r--r--py00/ex6/ft_count_harvest_recursive.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/py00/ex6/ft_count_harvest_recursive.py b/py00/ex6/ft_count_harvest_recursive.py
new file mode 100644
index 0000000..f25372b
--- /dev/null
+++ b/py00/ex6/ft_count_harvest_recursive.py
@@ -0,0 +1,14 @@
+def ft_print_days(days, count):
+ if days > 0:
+ print("Day:", count)
+ count += 1
+ days -= 1
+ ft_print_days(days, count)
+ else:
+ print("Harvest time!")
+
+
+def ft_count_harvest_recursive():
+ days = int(input("Days until harvest: "))
+ count = 1
+ ft_print_days(days, count)