[Solved] Find the lowest value in dict [closed]
The one-line answer using the min function with personalized key would be min(chars_dict, key=lambda(item): chars_dict[item][‘hp’]) I think it’s the best solution, because you want to find the element with the lowest ‘hp’. Also, if you’re using dictionaries as containers with constant keys, it may be better to use custom classes. And if the keys in … Read more