0

How can I solve this problem?

f = ['a', 'b', 'c', 'd', 'e', 'f', 10, 20, 30]
g = map(lambda v: v*2, f)
print(g)

output:

<map object at 0x000001C73448B320>
m0nhawk
  • 22,980
  • 9
  • 45
  • 73

1 Answers1

0

Python map function returns an iterator. So to solve your problem, just convert the map object to a list.

g = list(map(lambda v: v * 2, f))
velvel
  • 31
  • 3