Answers for "extract specific key values from nested dictionary"

0

extract specific key values from nested dictionary

l = []
for person in people:
    l.append(people[person]['phone'])

>>> l
['9102', '2341', '4563']
Posted by: Guest on March-06-2021
0

extract specific key values from nested dictionary

>>> [people[i]['phone'] for i in people]
['9102', '2341', '4563']
Posted by: Guest on March-06-2021
0

extract specific key values from nested dictionary

>>> [val.get('phone') for val in people.values()]
['4563', '9102', '2341']
Posted by: Guest on March-06-2021

Code answers related to "extract specific key values from nested dictionary"

Browse Popular Code Answers by Language