So I tried to sum the array with a while loop, something is going wrong. I get this type of error:
total = total + index[numbers] TypeError: 'int' object is not subscriptable
Here's my code
numbers = [1,5,6,3,7,7,8]
index = 0
total = 0
while index <= len(numbers):
total = total + index[numbers]
index += 1
The answer that I should get is 37, with using the while loop.
numbers[index].