Skip to content
Advertisement

Converting list of dictionary to list of lists

I have list of dictionary like below

JavaScript

I want to convert it like below

JavaScript

Appreciate your help !

Advertisement

Answer

You can use list comprehension, where you iterate each dictionary in the list, and get the list of values only for each dictionary:

JavaScript

OUTPUT:

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