Created
February 9, 2016 23:27
-
-
Save anonymous/891c81941f384c6c360e to your computer and use it in GitHub Desktop.
Pasted from IPython
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def dicty(d, key=None): | |
temp_d = {} | |
if key: | |
for k,v in d.items(): | |
if k.lower() == key.lower(): | |
print "{}: {}".format(k,v) | |
if isinstance(v, dict): | |
dicty(v, key) | |
if isinstance(v, list): | |
for x in v: | |
if isinstance(x, dict): | |
dicty(x, key) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment