sum()
函数:返回一个可迭代对象的总和。例如:
numbers = [1, 2, 3, 4, 5] print("The sum of the numbers is", sum(numbers))
输出:
The sum of the numbers is 15
sum()
函数:返回一个可迭代对象的总和。例如:
numbers = [1, 2, 3, 4, 5] print("The sum of the numbers is", sum(numbers))
输出:
The sum of the numbers is 15