example
Class car:
def car(color, price, speed):
self.color = color
self.price = price
self.speed = speed
A list car_list
is generated with 10 instances of car
car_list = [car1,car2,car3,car4,car5,car6,car7,car8,car9,car10,]
Each car object has a random color, price and speed value.
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.
red_cars=[car4,car7,car10]
A lot of googling didn't help me get started.