Answers for "make a list of dictionary values python"

0

get dictionary in array python by value

>>> dicts = [
...     { "name": "Tom", "age": 10 },
...     { "name": "Mark", "age": 5 },
...     { "name": "Pam", "age": 7 },
...     { "name": "Dick", "age": 12 }
... ]

>>> next(item for item in dicts if item["name"] == "Pam")
{'age': 7, 'name': 'Pam'}
Posted by: Guest on November-10-2020
1

a list of keys and a list of values to a dictionary python

dict(zip(a, b))
Posted by: Guest on August-01-2021
2

list of dictionary values

d.values()
Posted by: Guest on March-10-2020

Code answers related to "make a list of dictionary values python"

Python Answers by Framework

Browse Popular Code Answers by Language