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.
25 lines
540 B
25 lines
540 B
# BELLYNCK Manon
|
|
# GUILLAUMIN-TORRES Ambre
|
|
# COVIN Clara
|
|
|
|
class Expression :
|
|
|
|
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)
|
|
|
|
if self.valeur == '+':
|
|
return addition(fils_gauche, fils_droit)
|
|
|
|
else :
|
|
pass
|
|
|
|
|
|
def __str__ : #affichage en dfs infixe
|
|
|
|
|
|
|