I was trying to extract unique items from a list in same order as present. I tried the following but it doesn't work. Can anyone tell me what is wrong?Thanks.
b = []
a = [10, 20, 340, 20, 10]
b = [i for i in a if i not in b]
print a
Edit:I had already seen similar ques to achieve this task.I wanted to know what was wrong in my code.