I want to get the indexes of the elements in the list which add up to the sum.
numbers = [10,2,3,5,8,200]
sum = 12
for i,v in numbers:
if i+v == sum:
print(numbers[i]), print(numbers[v])
else:
print("other")
But I get this error:
Traceback (most recent call last):
File "C:\User\User\PycharmProjects\training\tests.py", line 9, in <module>
for i,v in numere:
TypeError: cannot unpack non-iterable int object