Post

@PythonPr # Correct answer: 114
num = [2, 3, 4, 5]
print(sum(num, 100))
# sum(num, 100) means:
# start with 100
# then add all numbers in num
# 100 + 2 + 3 + 4 + 5 = 114
English

@PythonPr B: 114
The sum() function in Python accepts an optional second argument for the starting value (default is 0).
sum([2, 3, 4, 5]) = 14
sum([2, 3, 4, 5], 100) = 14 + 100 = 114
English

@PythonPr 114 Because sum() adds the starting value (100) to the total of the list (14), giving 114.
English























