📜  python sum - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:41.843000             🧑  作者: Mango

代码示例4
# Python code to demonstrate the working of 
# sum()
   
numbers = [1,2,3,4,5,1,4,5]
  
# start parameter is not provided
Sum = sum(numbers)
print(Sum)
  
# start = 10
Sum = sum(numbers, 10)
print(Sum)

# Output -
# 25
# 35