Aby porównać część ciągu z ciągiem
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):
...