title: python find index of the first duplicate within a list
body: <p>i want to iterate through a list so i can find the index number where the first item in the list finds its first match. my results should print <code>mylist[0:first_match]</code></p>
  
  <p>here is what i mean:</p>
  
  <pre><code>.APT 5B              APT 5B  .
  .BUSINESS   JOEY     BUSINESS.
  .                    1ST FL  .
  .        NATE JR    SAM      .
  .        JOE       7         .
  .                            .
  .2ND FLR TOM         2ND FLR .
  .A1 2FL           APT 71E    .
  .APT E205            APT 1R  .
  .        CONSTRUCTION        .
  .APT 640              APT 545.
  .PART1   SYNC  PART2         .
  .  NATE JR        SAM        .
  </code></pre>
  
  <p>the problem im running into is the program keeps adding items to dictionary even after the first match is found therefore appending data that i want to ignore/bypass..</p>
  
  <p>here is what i have:</p>
  
  <pre><code>dictt = {}
  with open(path + 'sample33.txt', 'rb') as txtin:
          for line in txtin:
              part2 = line[1:29].split()
              uniq = []
              print '%r' % part2
  
              for key in part2:
                  if key not in dictt:
                      dictt[key] = key
                      uniq.append(key)
              dictt = {}
              print ' '.join(uniq)
  </code></pre>
  
  <p>Results:</p>
  
  <pre><code>['APT', '5B', 'APT', '5B']
  APT 5B
  ['BUSINESS', 'JOEY', 'BUSINESS']
  BUSINESS JOEY
  ['1ST', 'FL']
  1ST FL
  ['NATE', 'JR', 'SAM']
  NATE JR SAM
  ['JOE', '7']
  JOE 7
  []
  
  ['2ND', 'FLR', 'TOM', '2ND', 'FLR']
  2ND FLR TOM
  ['A1', '2FL', 'APT', '71E']
  A1 2FL APT 71E
  ['APT', 'E205', 'APT', '1R']
  APT E205 1R          # Would like to stop adding items after first 'APT' match
  ['CONSTRUCTION']
  CONSTRUCTION
  ['APT', '640', 'APT', '545']
  APT 640 545          # same here...
  ['PART1', 'SYNC', 'PART2']
  PART1 SYNC PART2
  ['NATE', 'JR', 'SAM']
  NATE JR SAM
  [Finished in 0.1s]
  </code></pre>
  
  <p>i hope i have explained this correctly and someone can fine tune it</p>
  
  <p>thank you</p>
  
  <p><strong>Edit #1</strong>
  here is an example of what i would like to print:</p>
  
  <pre><code>listt:
      ['APT', '640', 'APT', '1', '2', '3']
  </code></pre>
  
  <p>found 'APT' match so:</p>
  
  <pre><code>print:
      APT 640
  </code></pre>
  
  <p>ignore <code>...'APT', '1', '2', '3']</code></p>