Python Forum
IndexError: tuple index out of range ?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
IndexError: tuple index out of range ?
#1
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?
Reply
#2
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...
"So, brave knights, if you do doubt your courage or your strength, come no further, for death awaits you all with nasty, big, pointy teeth!" - Tim the Enchanter
Reply
#3
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.
Reply
#4
(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.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#5
it was a silly mistake already solved, grateful for the help.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  IndexError: list index out of range" & "TypeError: The view function f: Flask Web App joelbeater992 5 3,455 Aug-31-2021, 08:08 PM
Last Post: joelbeater992
  Python BeautifulSoup IndexError: list index out of range rhat398 1 6,163 May-28-2021, 09:09 PM
Last Post: Daring_T
  Getting 'list index out of range' while fetching product details using BeautifulSoup? PrateekG 8 8,048 Jun-06-2018, 12:15 PM
Last Post: snippsat
  List index out of range Prince_Bhatia 3 5,393 Dec-19-2017, 12:09 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020