Optimisation de "resolv_bl()"

This commit is contained in:
Antoine Van Elstraete 2022-01-25 12:57:12 +01:00
parent 25669da340
commit 332c571b71
Signed by: AntoineVe
GPG Key ID: E36069A977E2A9ED

View File

@ -96,12 +96,7 @@ def resolv_bl(liste, lettres):
for lettre in lettres:
if lettre in mot:
MotsSuppr.append(mot)
for mot in MotsSuppr:
try:
liste.pop(liste.index(mot))
except ValueError:
pass
return liste
return [mot for mot in liste if not mot in MotsSuppr]
if __name__ == "__main__":