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>
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>
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))