View dict_comprehension.py
bad_dict = {
'good_key': '1',
'bad_key': '2'
}
good_dict = {key: val for key, val in bad_dict.items() if 'bad_key' not in key}