Python - How to sort a list, by an attribute from another class
问题 I have some elements in a list in one class. I want them sorted in a new list, and they have to be sorted by an attribute from another class. Can anyone give an example? My code so far looks like this: class Carcompany: def __init__(self, model, production_number): self.model = model self.production_number = production_number self.car_list = [] def add_car_to_car_list(self, car): self.car_list.append(car) class Info: def __init__(self): self.license_plate_number = [] def add_license_plate_to