get key with value nested dict code example
Example 1: extract specific key values from nested dictionary
>>> [people[i]['phone'] for i in people]
['9102', '2341', '4563']
Example 2: extract specific key values from nested dictionary
>>> [val.get('phone') for val in people.values()]
['4563', '9102', '2341']