tg4/Chapitre 2 - Récursivité/exercices.py

18 lines
231 B
Python
Raw Normal View History

2023-09-21 13:09:01 +00:00
def rebours(n):
if n == 0:
print()
return
print(n, end=" ")
rebours(n-1)
rebours(12)
def compte(t, n=1):
print(n, end=" ")
if n < t:
compte(t, n+1)
else:
print()
compte(5)