Integer isn't iterable?

def substring_between_letters(word,start,end):
the_list =
the_end_list =
for i in range(0,len(word)):
if(word [i] == start):
the_list.append(i)
for j in range(len(word)-1,-1,-1):
if(word [j] == end):
the_list.append(j)
return word[the_list[0]:the_list[-1]]
I get a warning that int object is not subscriptable. I am wondering Why cannot I acces my list in the function