Explore Courses Blog Tutorials Interview Questions
0 votes
in Python by (47.6k points)

How can I get a list of the values in a dict in Python?

In Java, getting the values of a Map as a List is as easy as doing list = map.values();. I'm wondering if there is a similarly simple way in Python to get a list of values from a dict.

1 Answer

0 votes
by (106k points)

You can use the below-mentioned method to get the list of values from dict in Python where dict.values returns a view of the dictionary’s values instead:


Related questions

0 votes
1 answer
asked Jul 10, 2019 in Python by Sammy (47.6k points)
0 votes
1 answer
0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers!

28.4k questions

29.7k answers


94.1k users

Browse Categories