# Write a function that takes a list of integers # and return the sum value of the list # # Example: for a given list [4, 5, 6, 7] # the function will return 22 # # Do not use any built-in functions except len() def sum_list(lst): result = 0 # initialize the sum for num in lst: result += num return result print(sum_list([4,5,6,7])) print(sum_list([11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30])) mylist = list(range(11, 31)) print(sum_list(mylist)) # list() transforms range(11,31)) into a list # of 11, 12, 13, ..., 30