-3

I tried to use the map function in Python, and got the lazy evaluation figures of 0x000002131F50ECC0 as an output. How can I ask Python to calculate the value instead of giving me an address?

Thanks in advance!

Code:-

A = [1, 2]
B = [3, 4]
min_value = map(min, A, B)
print(min_value)

Result:-

<map object at 0x000002131F50ECC0>
H42
  • 613
  • 1
  • 6
  • 21

1 Answers1

0

Just ask the result as a list - the list constructor will consume the items in the map iterable:

min_value = list(map(min, A, B))
jsbueno
  • 86,446
  • 9
  • 131
  • 182