I got an error message from my code which says TypeError: 'int' object is unsubscriptable
. After doing some research, I understand what it means, but I can't understand why there is a problem.
I narrowed the problem down to this code:
def calcNextPos(models, xcel): # and other irrelevant parameters
for i in range(len(models)):
for j in range(3):
a = xcel[i[j]]*0.5*dt*dt
# More code after this...
I verified that xcel
is a list of lists of integers when the function is called, and the indexes should not be out of bounds.
What is going wrong? How can I fix it?