new = 0 for n,item in enumerate(b): if item != b[n-new]: print item new += 1