error message
indexError: list index out of range
solution
When this kind of error is reported, one way to solve this error is to try to print the list or its length. The list may be completely different from what you think, especially when the program is dynamically processing it.