'Retrieving value based on another value from a nested key:value list
I am working with a nested list of dictionaries and want to retrieve a value based on another value within the same item. An example of the data would be:
'''[{'name': 'foo', 'id': 3327}, {'name': 'bar','id': 3360}]'''
Ultimately I want to acquire the id of an object when only the name is known (sourced elsewhere as a variable). Could anyone offer assistance on querying the list by it's name and returning the value for the related id key?
Any help at all would be greatly appreciated.
Thanks
Craig
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
