小编Bin*_*ary的帖子

如何通过列表中的值获取列表的值?

我有以下字典:

d = {'1' : [1, 2, 3, 4], '2' : [10, 20, 30, 40]}
Run Code Online (Sandbox Code Playgroud)

如何通过其中一个列表中的值获取相应的密钥?假设我正在寻找值3或键'2',如果我正在寻找值10,那么我想要键'1'.

python dictionary list python-3.x

3
推荐指数
1
解决办法
68
查看次数

标签 统计

dictionary ×1

list ×1

python ×1

python-3.x ×1