0

I was trying to delete some dictionary items from a provided black_list and I would like to know (since I am new to this language) if there is a better alternative to the code I've implemented:

for unwanted_item in black_list:
            for item_name in dict.keys():
                    if unwanted_item in item_name:
                            del dict[item_name]

Thanks :)

0 Answers0