用items方法遍历到的字典值value是不是形参,要改字典的话还是得用dict[key]?
for m, v in work.items():
if star <= k and end > k:
v = v + 1 # 字典的key没改变?
work[m] = v # 字典的key改变了?
print(m, v)
用items方法遍历到的字典值value是不是形参,要改字典的话还是得用dict[key]?
for m, v in work.items():
if star <= k and end > k:
v = v + 1 # 字典的key没改变?
work[m] = v # 字典的key改变了?
print(m, v)