Ajout bbas

This commit is contained in:
Tipragot 2023-10-04 10:39:06 +02:00
parent 701101383f
commit f1daf341ec
No known key found for this signature in database

View file

@ -78,6 +78,11 @@ def bhaut(n: int):
print("*" * n) # On affiche n points print("*" * n) # On affiche n points
bhaut(n-1) # On fait appel à la fonction avec n-1 points pour afficher la ligne suivante bhaut(n-1) # On fait appel à la fonction avec n-1 points pour afficher la ligne suivante
def bbas(n: int):
if n == 0: return # Si n est égal a 0 on ne fais rien
bbas(n-1) # On fait appel à la fonction avec n-1 points pour afficher la ligne suivante
print("*" * n) # On affiche n points
def pair(n: int) -> bool: def pair(n: int) -> bool:
""" """
Fonction récursive qui renvoie True si n est pair et False sinon. Fonction récursive qui renvoie True si n est pair et False sinon.