Skip to content

Instantly share code, notes, and snippets.

@imsickofmaps
Created June 26, 2015 10:09
Show Gist options
  • Save imsickofmaps/21afde13574d91d0f887 to your computer and use it in GitHub Desktop.
Save imsickofmaps/21afde13574d91d0f887 to your computer and use it in GitHub Desktop.
actual = {
"key1": "yes",
"key2": "yes",
"key3": "yes"
}
expect = ["key1", "key2", "key3"]
present = set(key in actual.keys() for key in expect)
if len(present) == 1 and list(present)[0] == True:
print "present and correct"
else:
print "keys missing"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment