Changement chaine->list->sort() avec la fonction sort() de geoffrey
This commit is contained in:
parent
97ebe81584
commit
20ff4a469b
|
@ -212,13 +212,10 @@ def sont_anagrammes1(chaine1, chaine2):
|
||||||
if len(chaine1) != len(chaine2):
|
if len(chaine1) != len(chaine2):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
l1 = list(chaine1)
|
c1 = sort(chaine1)
|
||||||
l2 = list(chaine2)
|
c2 = sort(chaine2)
|
||||||
|
|
||||||
l1.sort()
|
return c1 == c2
|
||||||
l2.sort()
|
|
||||||
|
|
||||||
return l1 == l2
|
|
||||||
|
|
||||||
question(2)
|
question(2)
|
||||||
|
|
||||||
|
|
Reference in a new issue