In python 3,
Write a function that will accept a list and return the sum ofall the numbers.
Example:
x=[10,15,20,12]
sumOfList(x) would return 57
Answer
def sumOfList(x): s = 0 for i in x: s += i return s#testingx=[10,15,20,12]print(sumOfList(x)) #would return 57
57