Instantly share code, notes, and snippets.

Embed
What would you like to do?
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}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment