title: How to find objects with the same value in a list and create a new list with those objects?
body: <p>example</p>
  
  <pre><code>Class car:
     def car(color, price, speed):
       self.color = color
       self.price = price
       self.speed = speed
  </code></pre>
  
  <p>A list <code>car_list</code> is generated with 10 instances of car</p>
  
  <pre><code>car_list = [car1,car2,car3,car4,car5,car6,car7,car8,car9,car10,]
  </code></pre>
  
  <p>Each car object has a random color, price and speed value.</p>
  
  <p>I want to create a function that checks if 2 or more cars have the same color for example. If yes, create a list with only those cars.</p>
  
  <pre><code>red_cars=[car4,car7,car10]
  </code></pre>
  
  <p>A lot of googling didn't help me get started.</p>