i have a list:
seq = ['soup','dog','salad','cat','great']
As per the definition of filter, below code fetches the correct result:
list(filter(lambda w: w[0]=='s',seq))
['soup','salad']
i.e returning the list containing only words starting with 's'
but if i am using map function, it is returning the list as true/false:
list(map(lambda w: w[0]=='s',seq))`
[True, False, True, False, False]
please explain the map function w.r.t. to the above example