返回最小值的键

zzz*_*zzz 2 python dictionary

我想dictionary在 Python 中返回 a中最小值的键。key, value 对的值会有几个数字,即dict[current] = (total, gone, heuristic). 如何返回最小消失值的键?

Stu*_*art 6

使用min具有拉姆达查找功能:

min(d, key=lambda k: d[k][1])
Run Code Online (Sandbox Code Playgroud)