I can't find the reason why map lambda doesn't work when I apply it to a list of objects, for example:
class test():
def __init__(self, input):
self.input =input
def print_intput(self):
print(self.input)
objectlist=[]
for count in list(range(1,6)):
objectlist.append(test(count))
for ob in objectlist:
ob.print_intput()
"""
This ouputs:
1
2
3
4
5
"""
map(lambda x: x.print_intput(), objectlist)
"""
This has no output
"""
Why is the first output method works, simple for loop, and the map(lambda method doesn't work in this case).