title: Efficiently finding duplicates in a list
body: <p>I have the function below which searches an array for duplicate entries and then returns a list of the duplicates.  I'd like to speed this piece of my code up, can anyone suggest a more efficient way?</p>
  
  <p>Code:</p>
  
  <pre><code>def findDupe(array):
      dupelist = []
      for i in range(len(array)):
          for j in range(len(array)):
              comp1 = array[i]
              comp2 = array[j]
              if comp1 == comp2 and i!=j:
                  if comp2 not in dupelist:
                      dupelist.append(comp2)
      return dupelist
  </code></pre>