def uniquify(lst):
 dct = {}
 result = []
 for k in lst:
  if (not dct.has_key(k)):
   result.append(k)
  dct[k] = 1
 return result

def uniquify ( lst ) : dct = { } result = [ ] for k in lst : if ( not dct . has_key ( k ) ) : result . append ( k ) dct [ k ] = 1 return result
make the elements of a list unique by inserting them into a dictionary .