How to remove multiple items from nested list in python 3, without using a list comprehension? And at times Indexerror came how to handle that?
split_list =[["a","b","c"],["SUB","d","e",],["f","Billing"]]
rem_word = ['SUB', 'Billing', 'Independent', 'DR']
for sub_list in split_list:
for sub_itm in sub_list:
if sub_itm not in rem_word:
print(sub_itm)
Output Comes like this:
a
b
c
d
e
f
Expected Output:
split_list =[["a","b","c"],["d","e",],["f"]]