code: def prettylist(list_):
      
      if not list_:
          return ''
  
      values = set()
      uniqueList = []
  
      for entry in list_:
          if not entry in values:
              values.add(entry)
              uniqueList.append(entry)
  
      return uniqueList[0] if len(uniqueList) == 1 \
          else '[' + '; '.join(uniqueList) + ']'
docs: Filter out duplicate values while keeping order.