From 332c571b713df564deb27d65366938cf84b67a82 Mon Sep 17 00:00:00 2001 From: Antoine Van Elstraete Date: Tue, 25 Jan 2022 12:57:12 +0100 Subject: [PATCH] Optimisation de "resolv_bl()" --- wgamesolv.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/wgamesolv.py b/wgamesolv.py index 23cdf84..d5ca283 100755 --- a/wgamesolv.py +++ b/wgamesolv.py @@ -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__":