I have a problem and need to create a function that adds values that are within a list. I have done this and the code is down, however, Python returns me the value 3 as a result, when in fact the value should be 103. I can not find the error at all, if anyone can help thanks.
Code below:
def soma(x):
total = 0
for i in x:
total += i
return total
l1 = [3,7,1,90,2]
print(soma(l1))