def abc(data): for a in data: print(a) if data.count(a) == 1: #print(a) data.remove(a) return data print (abc([1, 2, 3, 4, 5]))