在下面给出的程序中,为什么运行程序后输出中包含“None”?你知道吗
def total_takings(monthly_takings):
list=[]
for earnings in monthly_takings:
list.append(monthly_takings[earnings])
print(sum(sum(list,[])))
test1= total_takings({'January': [54, 63], 'February': [64, 60], 'March': [63, 49], 'April': [57, 42], 'May': [55, 37], 'June': [34, 32], 'July': [69, 41, 32], 'August': [40, 61, 40], 'September': [51, 62], 'October': [34, 58, 45], 'November': [67, 44], 'December': [41, 58]})
print(test1)
total_takings()
不显式返回任何内容,因此它默认返回None
。你知道吗相关问题 更多 >
编程相关推荐