mirror of
https://github.com/DavidGailleton/42-Piscine_Python.git
synced 2026-11-01 08:52:03 +01:00
piscine 00
This commit is contained in:
1 parent
029903f8dd
commit
01854a4fb7
9 files changed
+62
No files matched your search
@@ -0,0 +1,6 @@
|
||||
def ft_count_harvest_iterative():
|
||||
print("Days until harvest:", end=" ")
|
||||
i = range(1, int(input()) + 1)
|
||||
for n in i:
|
||||
print("Day", n)
|
||||
print("Harvest time!")
|
||||
@@ -0,0 +1,9 @@
|
||||
def ft_count_harvest_recursive(x=-1):
|
||||
if x < 0:
|
||||
print("Days until harvest:", end=" ")
|
||||
x = int(input())
|
||||
ft_count_harvest_recursive(x)
|
||||
print("Harvest time!")
|
||||
elif x > 0:
|
||||
ft_count_harvest_recursive(x - 1)
|
||||
print("Day", x)
|
||||
Reference in new issue
Block a user