小编wil*_*aff的帖子

Python中的键,字典中的值

到目前为止,这是我的代码:

for keys, values in CountWords.items():
    val = values
    print("%s: %s \t %s: %s" % (keys, val, keys, val))
Run Code Online (Sandbox Code Playgroud)

当它被打印时,它将输出该键及其值,然后在空格后输出相同的内容.我想知道的是,如果我能得到第二个%s:%s来从字典中选择下一个键和值.

python iteration dictionary key-value

4
推荐指数
2
解决办法
2万
查看次数

标签 统计

dictionary ×1

iteration ×1

key-value ×1

python ×1