a=[1,2,3,2,1,4,1,5]
print a
c={}
for aa in a:
if not aa in c: c[aa]=1
else: c[aa]+=1
b=[i for i in a if c[i]>=2]
print b
YT1bMSwyLDMsMiwxLDQsMSw1XQpwcmludCBhCgpjPXt9CmZvciBhYSBpbiBhOgogIGlmIG5vdCBhYSBpbiBjOiBjW2FhXT0xCiAgZWxzZTogY1thYV0rPTEKCmI9W2kgZm9yIGkgaW4gYSBpZiBjW2ldPj0yXQpwcmludCBiCg==
[1, 2, 3, 2, 1, 4, 1, 5]
[1, 2, 2, 1, 1]