From 7d68c64b63941ed29b151349f512e8983b5d2570 Mon Sep 17 00:00:00 2001 From: manon Date: Thu, 30 Jan 2025 11:53:13 +0100 Subject: [PATCH] y'a rien qui va --- projet_calculatrice.py | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/projet_calculatrice.py b/projet_calculatrice.py index 0ef9ec7..f306937 100644 --- a/projet_calculatrice.py +++ b/projet_calculatrice.py @@ -16,7 +16,7 @@ class Expression : elif self.valeur == '+': return addition(valeur.gauche, valeur.droit) - def parcours_dfs_infixe(a): + def __str__ (self): """Affiche tous les nœuds de l'arbre a par un parcours DFS préfixé.""" if a is None: return @@ -24,22 +24,14 @@ class Expression : print(a.valeur) parcours_dfs_infixe(a.droit) - - - def __str__ (self): #affichage en dfs infixe - for val in self.__file: - s = str(val) - return s - - def multiplication (valeur.gauche, valeur.droit): + """multiplie la valeur des fils gauche et droits""" if valeur.gauche == int and valeur.droit == int : return valeur.gauche * valeur.droit - def addition (valeur.gauche, valeur.droit): + """additionne les valeurs des fils gauche et droits""" if valeur.gauche == int and valeur.droit == int : return valeur.gauche + valeur.droit - \ No newline at end of file