I am still new to coding so i apologize for the basic question. How do I add to elements of two seperate lists?
listOne = [0, 1 , 7, 8]
listTwo = [3, 4, 5, 6]
listThree = []for i in listOne:listAdd = (listOne[i] + listTwo[i])listThree.append(listAdd)
print(listThree)
I want the output to be [3, 5, 12, 14]
but i keep getting a syntax error saying
TypeError: List indices must be integers, not strings.
I thought this may have to do with i possibly being a string so i put int(i)
as the first line after the for loop but this did not help.