怎么把python字典的里的所有列表值相加?题目如下,我尝试提取提取所有列表在把他们相加但是不成功,求大神解答!
def total_takings(yearly_record):
sum = 0
for key,value in yearly_record.items():
for i in value:
sum += i
return sum
sum = 0
for key,value in yearly_record.items():
for i in value:
sum += i
return sum
温馨提示:答案为网友推荐,仅供参考