IndexError: tuple index out of range —– Python

Probably one of the indices is wrong, either the inner one or the outer one.

I suspect you meant to say [0] where you said [1], and [1] where you said [2]. Indices are 0-based in Python.

Leave a Comment