SumListnums function nums is a list of numbers The function

SumList(nums) function, nums is a list of numbers. The function returns the sum of the numbers In the list. You must use an accumulator variable. When correctly implemented, the following test() function will generate 105:

Solution

# sum using a variable

def sumList(nums):

total = 0

for i in nums:

total = total + i

return total

 SumList(nums) function, nums is a list of numbers. The function returns the sum of the numbers In the list. You must use an accumulator variable. When correctl

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site