d = {'abc': 'abc', 'def': {'ghi': 'ghi', 'jkl': 'jkl'}}
for ele in list(d.values()):
    if isinstance(ele, dict):
        for k, v in list(ele.items()):
            pass
How to check if a variable is a dictionary in python