Removing items in a dictionary
dict = {('Ghostbusters', 2016): 5.4, ('Ghostbusters', 1984): 7.8, ('Cars', 2006): 7.1} to_remove = [] for i in dict: if(i[1] < 2000): to_remove.append(i) for i in to_remove: dict.pop(i) dict