Merge branch 'master' of githubu:GeoffreyFrogeye/tp-info

This commit is contained in:
Jean-Loup Beaussart 2015-02-03 10:46:07 +01:00
commit 787128d661
3 changed files with 6 additions and 7 deletions

1
S2/TP2/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
lexique*

2
S2/TP2/configure vendored Normal file
View file

@ -0,0 +1,2 @@
wget http://www.fil.univ-lille1.fr/~L1S2API/CoursTP/lexique.zip
unzip lexique.zip

View file

@ -190,11 +190,7 @@ partie('Anagrammes') # Jean-loup
question(1)
def sont_anagrammes3(chaine1, chaine2):
""" Prédicat, renvoie True si chaine1 et chaine2 sont des anagrammes, False sinon
str, str -> bool
CU: chaine1 et chaine2 sont des str
"""def sont_anagrammes1(chaine1, chaine2):
def sont_anagrammes1(chaine1, chaine2):
""" Prédicat, renvoie True si chaine1 et chaine2 sont des anagrammes, False sinon
str, str -> bool
CU: chaine1 et chaine2 sont des str
@ -233,7 +229,7 @@ def sont_anagrammes2(chaine1, chaine2):
question(3)
def sont_anagrammes2(chaine1, chaine2):
def sont_anagrammes3(chaine1, chaine2):
""" Prédicat, renvoie True si chaine1 et chaine2 sont des anagrammes, False sinon
str, str -> bool
CU: chaine1 et chaine2 sont des str
@ -244,7 +240,7 @@ def sont_anagrammes2(chaine1, chaine2):
if len(chaine1) != len(chaine2): # Si la longueur est différente ca ne peut pas être des anagrammes
return False
for i in chaine1:
for i in chaine1:
if chaine1.count(i) != chaine2.count(i):
return False