Python Forum

Full Version: IndexError: tuple index out of range ?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have a perfectly functioning code that accesses certain array indexes with problems!

The following message appears in the terminal: IndexError: tuple index out of range?

What would that error be?
Just like the error says, you're trying to access an element in a tuple with an index that is out of its range. Can't say more without seeing the code...
If you post the code and the error it should be easy to spot. When python indexes it starts a 0 not 1. So, if you have eg range(5) it is indexed as "0, 1, 2, 3, 4". That's usually the issue.
(Jan-20-2020, 05:06 PM)JohnnyCoffee Wrote: [ -> ]I have a perfectly functioning code that accesses certain array indexes with problems!
you understand the inherent contradiction in this statement, right? :-)
post the code in python tags, the full traceback - in error tags.
it was a silly mistake already solved, grateful for the help.