You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
540 B

1 month ago
# BELLYNCK Manon
# GUILLAUMIN-TORRES Ambre
# COVIN Clara
class Expression :
4 weeks ago
def __init__ (valeur_racine, fils_gauche, fils_droit):
self.valeur = valeur_racine
self.gauche = fils_gauche
self.droit = fils_droit
def évalue (self):
if self.valeur == '*':
return multiplication(fils_gauche, fils_droit)
4 weeks ago
if self.valeur == '+':
return addition(fils_gauche, fils_droit)
else :
pass
4 weeks ago
1 month ago
def __str__ : #affichage en dfs infixe
4 weeks ago