I want to put the unique items from one list to another list, i.e eliminating duplicate items. When I do it by the longer method I am able to do it see for example.
>>>new_list = []
>>>a = ['It', 'is', 'the', 'east', 'and', 'Juliet', 'is', 'the', 'sun']
>>> for word in a:
if word not in a:
new_list.append(word)
>>> new_list
['It', 'is', 'the', 'east', 'and', 'Juliet', 'sun']
But when try to accomplish this using list comprehension in a single line the each iteration returns value "None"
>>> new_list = []
>>> a = ['It', 'is', 'the', 'east', 'and', 'Juliet', 'is', 'the', 'sun']
>>> new_list = [new_list.append(word) for word in a if word not in new_list]
Can someone please help in understanding whats going wrong in the list comprehension.
Thanks in Advance Umesh