Skip to content

Instantly share code, notes, and snippets.

@zachwill
Created September 18, 2011 03:36
Show Gist options
  • Save zachwill/1224692 to your computer and use it in GitHub Desktop.
Save zachwill/1224692 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
"""For ctbarna."""
list_of_dicts = [
{'key_1': 'value_1', 'key_2': 'value_2'},
{'key_1': {'inception_key': 'inception_value'}, 'key_2': 'value_2'},
{'key_1': 'value_1', 'key_2': 'value_2'},
]
for d in list_of_dicts:
for key in d:
if isinstance(d[key], dict):
print d['key_2']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment