[Solved] Python dictionary printing specific value [closed]

[ad_1]

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

[ad_2]

solved Python dictionary printing specific value [closed]