The function sum_list should return the sum of all elements in a list.
Something is wrong — it seems to miss the last element. Find the bug and fix it.
Don't use sum() built-in — you must iterate manually.
forsum()Read the code. Before running anything: what does the last line below give?