I am trying to remove elements from a list where the substring is in the list. I have tried the following code:
for string in list(data): if \'sub\' in string