小编san*_*and的帖子

如何为特定键返回字典值的常用值?

我有一本字典,其中包含:

{'Key': ['File1', 'File2']}
Run Code Online (Sandbox Code Playgroud)

where key对应于单词,files是包含该单词的文件集.

假设我有一本字典:

{'banana': ['file1.txt', 'file2.txt', 'file3.txt'],
 'apple': ['file2.txt', 'file3.txt']}
Run Code Online (Sandbox Code Playgroud)

我的查询是banana apple.我怎么比较,我只返回这样价值观file2.txtfile3.txt

python dictionary

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

标签 统计

dictionary ×1

python ×1