Skip to content
Advertisement

merge two lists into dictionary

I’m trying to merge two lists to dict:

JavaScript

I’d like to get:

JavaScript

trying to use zip but get an error :”<zip object at 0x000>”

Advertisement

Answer

You can try this:

JavaScript

Output:

JavaScript

I wouldn’t consider this an ideal data structure though, unless you have a lot more data in the individual dictionaries.

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