写一段python3的函数求以下变量中列表元素的和a=1b=23c=d=567
def sum_list_elements(*args): total_sum = 0 for lst in args: total_sum += sum(lst) return total_sum
a = [1] b = [2,3] c = [] d = [5,6,7]
print(sum_list_elements(a,b,c,d)) # Output: 24
原文地址: https://www.cveoy.top/t/topic/dU6v 著作权归作者所有。请勿转载和采集!