1>>> my_dict = {
2... "keyA": 1,
3... "keyB": 2,
4... "keyC": 3
5... }
6>>> invalid = {"keyA", "keyB"}
7>>> def without_keys(d, keys):
8... return {x: d[x] for x in d if x not in keys}
9>>> without_keys(my_dict, invalid)
10{'keyC': 3}