Your function is working but you need to call it with your list to get a result.
And beware not to name a variable "sum" as this is an inbuild python function
actually the one that does what you rebuild.
And beware not to name a variable "sum" as this is an inbuild python function
actually the one that does what you rebuild.
def sum_list(elements): total = 0 for element in elements: total += element return total broken_prices = [5, 3, 4, 5, 4] + [4] print(sum_list(broken_prices)) # ==> 25 print(sum(broken_prices))