SyntaxFix
Write A Post
Hire A Developer
Questions
Use the __contains__() method of Pythons string class.:
__contains__()
a = ['abc-123', 'def-456', 'ghi-789', 'abc-456'] for i in a: if i.__contains__("abc") : print(i, " is containing")