How to print a Map object in Python
If you try to print a map object in python, you’ll see the following output in your terminal.
x = ["52", "54", "99"]
y = map(int, x)
print(y)
Output:
<map object at 0x7f91de6400b8>
To print the Map object in Python, first we need to convert the map object into a list using the list()
function then print it using the print() function.
Here is an example:
x = ["52", "54", "99"]
y = map(int, x)
print(list(y))
Output:
[52, 54, 99]