Mar-10-2018, 08:53 PM
is list() new in python3? I ask because my lambda functions will provide my lambda object name without list() only. But won't print without list(). Many lambda examples on the net work without list() [http://www.secnetix.de/olli/Python/lambd...tions.hawk]
Output:>>> sentence ='it is raining'
>>> words = sentence.split()
>>> print(words)
['it', 'is', 'raining']
>>> lengths = map(lambda word: len(word),words)
>>> print(lengths)
<map object at 0x7f82ad3a0b70>
>>> print(list(lengths))
[2, 2, 7]
>>>