diff --git a/Chapitre 2 - Récursivité/exercices.py b/Chapitre 2 - Récursivité/exercices.py new file mode 100644 index 0000000..1a5c342 --- /dev/null +++ b/Chapitre 2 - Récursivité/exercices.py @@ -0,0 +1,17 @@ +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)