Created
March 21, 2011 19:52
-
-
Save mzupan/880083 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/usr/bin/env python | |
d = { | |
'football': { | |
'jets': { | |
'bad': True | |
}, | |
} | |
} | |
e = {'paul': 'loves V'} | |
def isNested(d): | |
for k,v in d.items(): | |
if type(v).__name__ == 'dict': | |
return True | |
return False | |
print isNested(d) | |
print isNested(d['football']) | |
print isNested(e) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment