To obtain list of values of a Dictionary in Python, the dictionary offers values()
method. It returns a collection of type dict_values
.
If we want to get all the values of a dictionary as a type of list
, we can do so using list comprehension as follows.
The output of the preceding code will return a collection of values
of type list
as shown as follows.