使用列表对象在Python中查找字典中的项目

Kev*_*vin 0 python dictionary list

我有一个wxPython核对表框,它返回一个整数列表.我想使用整数来查找字典中的项目.我不确定最好的方法.有什么建议?

S.L*_*ott 7

你在问

[ someDict[k] for k in someList ]
Run Code Online (Sandbox Code Playgroud)