[Solved] Python dictionary printing specific value [closed]


In this simple case, you can create a dictionary with the keys being the roles themselves:

> roles = {d['role']:d for d in dic}
> roles['NOC']['email']

Note that you are still looping through all dictionary items to create the new one.

0

solved Python dictionary printing specific value [closed]