From 72d65973dceb0127cb94236df10b590a11875351 Mon Sep 17 00:00:00 2001 From: Geoffrey Frogeye Date: Tue, 3 Feb 2015 11:30:42 +0100 Subject: [PATCH] TP2 Avancement Annagrammes phrases Avant ragequit --- S2/TP2/tp2.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/S2/TP2/tp2.py b/S2/TP2/tp2.py index 3c221af..e9f1858 100644 --- a/S2/TP2/tp2.py +++ b/S2/TP2/tp2.py @@ -426,9 +426,12 @@ question(1) def arbre_vers_liste(arbre): - # [[1, [3, 4]], [2, [3, 4]]] ⇒ [[1, 3], [1, 4], [2, 3], [2, 4]] + # [[1, [3, [4]]], [2, [3, [4]]]] ⇒ [[1, 3], [1, 4], [2, 3], [2, 4]] print(arbre) possibilites = [] + # for i in arbre: + + return possibilites @@ -458,5 +461,5 @@ def annagrammes_phrase(phrase): annagrammesMots = [anagrammes(i) for i in mots] return arbre_vers_liste(anagrammesArbre) -print(annagrammes_phrase('une dactylographié')) # DEBUG +print(annagrammes_phrase('orange orange orange')) # DEBUG