I am curious about a thing:
I have a dict, for example with a car as key and a value regarding its speed. Now, I want to find the key with the lowest value.
How about this:
car_dict = {'mercedes': 200, 'fiat': 100, 'porsche': 300, 'rocketcar': 600} min_car = {} for car in car_dict: if not min_car or car_dict[car] < min_car['speed']: min_car['name'] = car min_car['speed'] = car_dict[car] print(min_car)