Using a list comprehension:

Copy>>> [dct[k] for k in lst]
[5, 3, 3, 3, 3]

Using map:

Copy>>> [*map(dct.get, lst)]
[5, 3, 3, 3, 3]
Answer from wim on Stack Overflow
🌐
30 Seconds of Code
30secondsofcode.org › home › list › list to dictionary
Python - Convert between lists and dictionaries - 30 seconds of code
July 4, 2024 - Instead of simply using zip(), you can apply the function to each value of the list using map() before combining the values into a dictionary. def map_dictionary(itr, fn): return dict(zip(itr, map(fn, itr))) map_dictionary([1, 2, 3], lambda ...
🌐
GeeksforGeeks
geeksforgeeks.org › python › convert-a-dictionary-to-a-list-in-python
Convert a Dictionary to a List in Python - GeeksforGeeks
July 23, 2025 - In conclusion, converting a dictionary to a list in Python is a straightforward process with multiple approaches. Depending on your specific use case, you can choose between extracting keys, values, or key-value pairs.
🌐
Python documentation
docs.python.org › 3 › tutorial › datastructures.html
5. Data Structures — Python 3.14.3 documentation
To avoid getting this error when trying to access a possibly non-existent key, use the get() method instead, which returns None (or a specified default value) if the key is not in the dictionary. Performing list(d) on a dictionary returns a list of all the keys used in the dictionary, in insertion order (if you want it sorted, just use sorted(d) instead).
🌐
TechBeamers
techbeamers.com › python-map-function
Python Map Function - TechBeamers
November 30, 2025 - The program prints the length of dictionary keys. From here, learn more about dictionaries in Python. We’ve said earlier that you could use constructor functions to convert a map to a list, tuple, set, etc.
🌐
30 Seconds of Code
30secondsofcode.org › home › list › list to dictionary
Map list to dictionary - Python - 30 seconds of code
July 4, 2024 - To convert a dictionary to a list of tuples, use dict.items() and list() to get a list of tuples from the given dictionary.
🌐
GitHub
gist.github.com › formido › 7d40e4791391020f2c02
map list of dicts with lambda in python · GitHub
I like to use higher order functions like map, I like to use lambdas, and I prefer to keep my intermediate data representations in lists of dictionaries.
Find elsewhere
🌐
Python Pool
pythonpool.com › home › blog › 9 ways to convert dictionary to list in python
9 Ways To Convert Dictionary to List in Python - Python Pool
April 30, 2023 - ... dictionary = {} is the syntax to create an empty dictionary. Use two curly brackets to initialize an empty dictionary. ... Map dictionary.get() over the list to get a list of values.
🌐
w3resource
w3resource.com › python-exercises › map › python-map-exercise-15.php
Python: Split a given dictionary of lists into list of dictionaries using map function - w3resource
Python Map Exercises, Practice and Solution: Write a Python program to split a given dictionary of lists into list of dictionaries using the map function.
🌐
AskPython
askpython.com › home › 5 easy ways to convert a dictionary to a list in python
5 Easy ways to convert a dictionary to a list in Python - AskPython
February 16, 2023 - Finally, we will create one Python tuple for each key: value pair of the given Python dictionary as we iterate over it and append this tuple to the empty list, we created. Let’s implement this method through Python code. # Method- 4 # Create a Python dictionary dr = {'Sanjay': 'ECE', 'Abhishek': 'EE', 'Sarthak': 'ICE'} print('Given Python dictionary:\n') print(dr) # Create an empty Python list ls = [] # Convert the above Python dictionary to a Python list # Using the for loop iteration for key in dr: item = (key, dr[key]) ls.append(item) print('\nThis is the Converted list:\n') print(ls)
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-get-dictionary-keys-as-a-list
Dictionary keys as a list in Python - GeeksforGeeks
The unpacking operator (*) can be used to extract keys directly. ... The unpacking operator expands the dictionary keys into a list. map() function can be used to explicitly iterate over the dictionary.
Published   July 11, 2025
🌐
EyeHunts
tutorial.eyehunts.com › home › map list to dictionary python | example code
Map list to dictionary Python | Example code
November 1, 2023 - Using the zip( ) function or dictionary comprehension you can convert the Map list to the dictionary in Python
🌐
DigitalOcean
digitalocean.com › community › tutorials › how-to-use-the-python-map-function
Ultimate Guide to Python Map Function for Data Processing | DigitalOcean
December 18, 2024 - We’ve mapped the new tank number to our list of dictionaries. Using a function that we define, we can incorporate map() to apply the function efficiently on each item of the list. In the same way as lambda functions or our own defined functions, we can use Python built-in functions with map().
🌐
Python Guides
pythonguides.com › python-dictionary-values-to-list
How to Convert Dict_Values to List in Python
September 22, 2025 - So, we are using the lambda() method to target the value of the key like this “lambda x: newspapers[x]“, and then the map() method will iterate over every key of the dict and apply the lambda function to extract dict values. In this Python article, you learned how to convert dict_values to list in Python using different methods, such as the dict.values(), map(), lambda() function, and other approaches, such as using the for loop and List comprehension.
🌐
30 Seconds of Code
30secondsofcode.org › home › python › map dictionary values
Python - Map dictionary values - 30 seconds of code
August 3, 2024 - def map_values(obj, fn): return dict((k, fn(v)) for k, v in obj.items()) users = { 'fred': { 'user': 'fred', 'age': 40 }, 'pebbles': { 'user': 'pebbles', 'age': 1 } } map_values(users, lambda u : u['age']) # {'fred': 40, 'pebbles': 1} Collection · 8 articles · An article collection of dictionary helpers and tips for Python 3.6. Python · May 8, 2024 · Invert a dictionary with non-unique hashable values. Python · June 12, 2021 · Learn the difference between two common ways to access values in Python dictionaries and level up your code today. Python · July 4, 2024 · Convert a dictionary to a list of tuples and vice versa.
🌐
TutorialsPoint
tutorialspoint.com › How-to-convert-Python-Dictionary-to-a-list
How to convert Python Dictionary to a list?
[('Hello', 10), ('Tutorialspoint', 20), ('python', 30)] Following are the Algorithm/steps to be followed to perform the desired task ? Create a variable to store the input dictionary. Print the list of all the keys of a dictionary with the keys() function(the dict.
🌐
Spark By {Examples}
sparkbyexamples.com › home › python › get python dictionary values as list
Get Python Dictionary Values as List - Spark By {Examples}
May 31, 2024 - Using the * operator we can also convert all dictionary values to a list in Python. Apply * operator in front of dict.values() method and pass them into the list. This syntax will return all the dict values as a list.
🌐
Reddit
reddit.com › r/learnpython › using list(map()) on a nested dict
r/learnpython on Reddit: Using list(map()) on a nested dict
May 15, 2018 -

So I have a list of characters. And let's say I need to get at each of the characters class types. Using map() in python 3, how exactly would one go about this? Here's the list of characters. I've tried going at this a few ways, but they have all failed. The real issue is that I'm not sure how to get at the nested dictionary.

chars = [{'Character1': {'age': 19, 'name': 'Balthazar', 
    'class': 'Wizard'}}, {'Character2': {'age': 24, 
    'name': 'Thadeus', 'class': 'Warrior'}}]

classes = list(map(lambda x: x.update({"classes": 
    list(map(lambda y: # need to get at each 'class' key 
    here to output to the list of classes), collection)}), 
    chars))

EDIT: This is something I'm working on at work. I'm a Jr. Dev, and these made up dictionaries hold no value to what I'm actually working on whatsoever. I just need to understand how this works and am not coming up with much in my searching.

🌐
Reddit
reddit.com › r/learnpython › how do you add a list as the value of a key inside a dictionary? what about tuples of lists?
r/learnpython on Reddit: How do you add a list as the value of a key inside a dictionary? What about tuples of lists?
April 3, 2022 -

I am trying to add a list, or a tuple of lists, as the value to a key inside a dictionary. I'm starting with a dictionary that has empty lists as values, and then adding to the value of each key inside a loop like this:

dict = {'key1': [], 'key2': [], 'key3': []}
list = ['a', 'b']
for key,value in dict.items():
#    dict[key].append(list)
    value.append(list)
print(dict)

What is the difference between dict[key].append(list) and value.append(list)? They both produce the same dictionary when the other is commented out.

Further, how would I add a second list to one of these values as a tuple? Something like adding the list ['c', 'd'] to key2, like this:

{'key1': [['a', 'b']], 'key2': [['a', 'b'], ['c', 'd']], 'key3': [['a', 'b']]}

Thanks for any replies!