diff --git a/projet_calculatrice.py b/projet_calculatrice.py index 9c3e2fe..b9baa2e 100644 --- a/projet_calculatrice.py +++ b/projet_calculatrice.py @@ -11,10 +11,10 @@ class Expression : def évalue (self): if self.valeur == '*': - return multiplication(fils_gauche, fils_droit) + return multiplication(valeur.gauche, valeur.droit) if self.valeur == '+': - return addition(fils_gauche, fils_droit) + return addition(valeur.gauche, valeur.droit) else : pass @@ -23,3 +23,14 @@ class Expression : def __str__ : #affichage en dfs infixe +def multiplication (valeur.gauche, valeur.droit): + if valeur.gauche == int and valeur.droit == int : + return valeur.gauche * valeur.droit + + +def addition (valeur.gauche, valeur.droit): + if valeur.gauche == int and valeur.droit == int : + return valeur.gauche + valeur.droit + + + \ No newline at end of file