0
Lambdas return map/list
how to return a list or map by using lambdas..?
2 Answers
0
here's an exemple on using a map on a whole liste:
liste=[1,2,3,4,5]
liste=list(map(lambda x: x+1,liste)
here's an exemple on returning a whole listed using lambda :
liste=[1,2,3,4,5]
print((lambda x:x)(liste))
- 1
thislist = [5,3,8,7,2]
thisismap = map(lambda y: y*y, thislist)
print(thisismap)