Lista de Python contém substring
str_list = ["one", "two", "three"]
substr = "wo"
if any(substr in str for str in str_list):
print('Yes!')
ARtemachka
str_list = ["one", "two", "three"]
substr = "wo"
if any(substr in str for str in str_list):
print('Yes!')
extensionsToCheck = ('.pdf', '.doc', '.xls')
'test.doc'.endswith(extensionsToCheck) # returns True
'test.jpg'.endswith(extensionsToCheck) # returns False