Python Programming - Dictionaries - Discussion

Discussion Forum : Dictionaries - General Questions (Q.No. 35)
35.
How do you extract all values from a dictionary and store them in a list?
values_list = dictionary.get_values()
values_list = list(dictionary.values())
values_list = dictionary.extract_values()
values_list = dictionary.all_values()
Answer: Option
Explanation:
The values() method is used to extract all values from a dictionary, and list() is used to convert it into a list.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.