title: Checking for the existence of an instance in a list, then adding that instance to another list in python
body: <p>I have the following list of instances:</p>
  <pre><code>diamondlist = []
  goldlist = []
  mylist = [Diamond((1, 2)), Gold((3, 4)), Diamond((2,3))]
  </code></pre>
  <p>I want to iterate through this list and check if the list contains a specific instance of an item and then add that specific instance to another list.</p>
  <p>For example, after iterating through the list I want to have two seperate lists of:</p>
  <pre><code>diamondlist = [Diamond((1,2)), Diamond((2,3))]
  goldlist = [Gold((3, 4))]
  </code></pre>
  <p>I don't really have an idea how to begin coding this but this is what I have so far.
  Note: I use 'diamondInstance' as a placeholder as I do not know what should go here.</p>
  <pre><code> if diamondInstance in mylist:
     diamondlist.append(diamondInstance)
  </code></pre>
  <p>Then I would just repeat this code for Gold.
  Thank you in advance</p>