Sometimes, we want to get a map() to return a list in Python 3.x.
In this article, we’ll look at how to get a map() to return a list in Python 3.x.
How to get a map() to return a list in Python 3.x?
To get a map() to return a list in Python 3.x, we can use the list
function.
For instance, we write
l = list(map(chr, [66, 53, 0, 94]))
to call list
with the map returned by map
to convert the map to a list.
Conclusion
To get a map() to return a list in Python 3.x, we can use the list
function.