extract specific key values from nested dictionary
l = []
for person in people:
l.append(people[person]['phone'])
>>> l
['9102', '2341', '4563']
extract specific key values from nested dictionary
l = []
for person in people:
l.append(people[person]['phone'])
>>> l
['9102', '2341', '4563']
extract specific key values from nested dictionary
>>> [people[i]['phone'] for i in people]
['9102', '2341', '4563']
extract specific key values from nested dictionary
>>> [val.get('phone') for val in people.values()]
['4563', '9102', '2341']
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us