Skip to content

Instantly share code, notes, and snippets.

@LouisBurke
Created October 8, 2015 15:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LouisBurke/6b73c0ac770136dafe17 to your computer and use it in GitHub Desktop.
Save LouisBurke/6b73c0ac770136dafe17 to your computer and use it in GitHub Desktop.
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