The index method will only return the first found index. So, when you append list2.index(0) to your indexnumber list, it will always append 0, since that is the first index of that value in list2. However, you don’t necessarily need to know the index at all. Here is an alternative method to achieve the same thing:
Essentially, this takes each list an associates their respective values at the same index through a zip() function. Where the second value is equal to 0, it will append the first value to a new list subset.