Skip to content
Advertisement

Creating dictionary need more than 1 value to unpack

I have two lists:

JavaScript

I also have a json file for each manager:

JavaScript

So now, I want to create a dictionary by to categorize data by site! which is making it challenging for me. The output I need is to show employees for each site.

Here is the code I have:

JavaScript

The error I get:

JavaScript

Advertisement

Answer

Instead of looping over sites, just test if the site of the employee is in the list.

The keys of the resulting dictionary should be the site names, not the manager names.

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement