Skip to content

Instantly share code, notes, and snippets.

@mzupan
Created March 21, 2011 19:51
Show Gist options
  • Save mzupan/880079 to your computer and use it in GitHub Desktop.
Save mzupan/880079 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
d = {
'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(e)
$ ./test.py
True
False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment