how to get keys from nested dictionary python code example
Example 1: extract specific key values from nested dictionary
>>> [val.get('phone') for val in people.values()]
['4563', '9102', '2341']
Example 2: extract specific key values from nested dictionary
l = []
for person in people:
l.append(people[person]['phone'])
>>> l
['9102', '2341', '4563']