I try to run
lst = ['ab','cd','cdc','cd','ab','abcd']
g = set()
list(map(lambda x:g.add(x),lst))
Then the set g contains correct elements
>>>print(g)
{'abcd', 'ab', 'cdc', 'cd'}
But if I remove the list conversion
lst = ['ab','cd','cdc','cd','ab','abcd']
g = set()
map(lambda x:g.add(x),lst)
Then g is empty
>>>print(g)
set()
Why does this happen