def hauteur(arbre): if arbre is None: return ... return ... + max(..., ...) def est_equilibre(arbre): if arbre is None: return ... if abs(hauteur(arbre[...]) - ...) > ...: return ... if not ...: return ... if ...: return ... return ...