python中字典怎么让key对应的value +1?

2025-05-09 00:16:21
推荐回答(1个)
回答1:

字典没有下标的概念了,是使用key进行索引,
把代码改成这样就可以了:
for key in record.keys():
record[key] += 1