i have list
my_list = ['Cat Dog Tiger Lion', 'Elephant Crocodile Monkey', 'Pantera Cat Eagle Hamster']
i need to delete all of elements which containing sub = 'Cat'
so i need to have output
['Elephant Crocodile Monkey']
i think i need to do something with regex, maybe re.compile to find this values and then drop them from my_list?
i have been tryed:
for string in my_list:
if string.find(sub) is not -1:
print("this string have our sub")
else:
print("sthis string doesnt have our sub")
but i dont know how to combine it with delete this rows from my_list