Question: 
Write a function to find the depth of a dictionary.


Model's Code:
def dict_depth(d):
    if isinstance(d, dict) and d:
        return 1 + max(dict_depth(v) for v in d.values())
    return 1



Sample Correct Code:
def dict_depth(d):
    if isinstance(d, dict):
        return 1 + (max(map(dict_depth, d.values())) if d else 0)
    return 0


Asserts:
assert dict_depth({'a':1, 'b': {'c': {'d': {}}}})==4
assert dict_depth({'a':1, 'b': {'c':'python'}})==2
assert dict_depth({1: 'Sun', 2: {3: {4:'Mon'}}})==3


Tests:
Test 1 of 3: PASS
Test 2 of 3: FAIL: AssertionError()

Test 301 of 974: 219/301 (72.75747508305648%): failed