Pour comparer une partie d'une chaîne à la chaîne
matching = [s for s in xs if "abc" in s]
ikram Lalmi
matching = [s for s in xs if "abc" in s]
xs = ['abc-123', 'def-456', 'ghi-789', 'abc-456']
if any("abc" in s for s in xs):
...