title: Remove duplicates from user input
body: <p>I want to ignore any duplicate entry given by user as input. I have below code :</p>
  <pre><code>def pITEMName():
      global ITEMList,fITEMList
      pITEMList = []
      fITEMList = []
      ITEMList = str(raw_input('Enter pipe separated list of ITEMS : ')).upper().strip()
      items = ITEMList.split(&quot;|&quot;)
      count = len(items)
      print  'Total Distint ITEM Count : ',  count
      pipelst = [i.replace('-mc','').replace('-MC','').replace('$','').replace('^','') for i in ITEMList.split('|')]
      filepath = '/location/data.txt'
      f = open(filepath, 'r')
      for lns in f:
              split_pipe = lns.split(':', 1)
              if split_pipe[0] in pipelst:
                      index = pipelst.index(split_pipe[0])
                      pITEMList=split_pipe[0]+&quot;|&quot;
                      fITEMList.append(pITEMList)
                      del pipelst[index]
      for lns in pipelst:
          print bcolors.red + lns,' is wrong ITEM Name' + bcolors.ENDC
      f.close()
  </code></pre>
  <p>When I execute above code it prompts me for user input as :</p>
  <blockquote>
  <p>Enter pipe separated list of items :</p>
  </blockquote>
  <p>And if I provide the input as :</p>
  <blockquote>
  <p>Enter pipe separated list of items : AAA|IFA|AAA</p>
  </blockquote>
  <p>After pressing enter I am getting the result as :</p>
  <blockquote>
  <p>Enter pipe separated list of Items : AAA|IFA|AAA</p>
  <p>Total Distint Item Count :  3</p>
  <p>AAA  is wrong Item Name</p>
  <p>Items Belonging to other Centers :</p>
  <p>Other Centers :</p>
  <p>Item Count From Other Center =  0</p>
  <p>Items Belonging to Current Centers :</p>
  <p>Active Items in  US1:</p>
  <p>^IFA$</p>
  <p>Active Items in  US2 :</p>
  <p>^AAA$|^AAA$</p>
  <p>Ignored Item Count From Current Center =  0</p>
  <p>You Have Entered ItemList belonging to this Center as:
  ^IFA$|^AAA$|^AAA$</p>
  <p>Active Item Count :  3</p>
  <p>Do You Want To Continue [YES|Y|NO|N] :</p>
  </blockquote>
  <p>In above result you must be noticing that I have mentioned AAA entry twice so its counting as wrong Item. I want as duplicate entry to be ignored. Here I want to ignore the case sensitive condition also. Means If I give AAA|aaa|ifa, one 'aaa' should get ignored.</p>
  <p>Please help me that how I can implement this.</p>