SyntaxFix
Write A Post
Hire A Developer
Questions
Loop through elements in the list and update the total like this:
def sum(a): total = 0 index = 0 while index < len(a): total = total + a[index] index = index + 1 return total