def new(a):
return a*a
x=map(new,[1,2,3,4,5])
print(x)
print(list(x))
print(tuple(x))
output is
<map object at 0x03717298>
[1, 4, 9, 16, 25]
()
why we are getting output as empty tuple with list(x)?
def new(a):
return a*a
x=map(new,[1,2,3,4,5])
print(x)
# print(list(x))
print(tuple(x))
output is:
<map object at 0x009E71D8>
(1, 4, 9, 16, 25)
the above code gives the tuple as the answer when we are not using list.