Skip to content
Advertisement

How to generate dictionaries from multiple lists?

I have the following lists :

JavaScript

And I would like to generate the following dictionaries:

JavaScript

Which kind of loop or function Should I use?

Advertisement

Answer

Use zip and the following comprehension:

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