Categories
Python Answers

How to get a map() to return a list in Python 3.x?

Spread the love

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.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *