Skip to content
Advertisement

how to get only specific values from dictionary using key in python

I have this kind of 50 dictionary means that I have over 50 kind of dictionary for different values. like symbol and other key value.

I want to get only symbol and open values in a list.

JavaScript

What I have tried:

JavaScript

Here data is the dictionary as mentioned above. please help. here is an example of several dictionaries.

Advertisement

Answer

(I have updated this answer, and assumed the dictionaries are stored in an array).

JavaScript

To solve this, we will just traverse through the array, and to get an index, and then obtain the value from each index of list of dictionaries:

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