def aa(nums): hashes={} for s in nums: hashes[s]=hashes[s]+1 if hashes.get(s) else 1 for s in nums: if hashes[s]==1: print (s) return print(aa([1,2,3,3,3,4,5,5]))