Python Forum
General list size question to solve problem
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
General list size question to solve problem
#1
I really appreciate all of the help I have gotten here. Need more.I have a list:
horses_info =  []
I run my program and append elements to the list. When I get to the following:

def extract_horse_data(horse_count):

                                    , horses_info.append(xx[horse_count][98])
it throws the following error. I have not anywhere in my code given the list any dimension limit.

Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Users\Milford\AppData\Local\Programs\Python\Python38-32\lib\tkinter\__init__.py", line 1883, in __call__
return self.func(*args)
File "pyfuncs.py", line 190, in select_track
load_track_to_Handi()
File "pyfuncs.py", line 159, in load_track_to_Handi
extract_horse_data(horse_count)
File "pyfuncs.py", line 101, in extract_horse_data
horses_info.append( xx[horse_count][96]),horses_info.append( xx[horse_count][97]), horses_info.append(xx[horse_count][98]),
IndexError: index 98 is out of bounds for axis 0 with size 98

I know what the error is saying, But I did not create the list with any dimensions at all.
Reply


Messages In This Thread
General list size question to solve problem - by Milfredo - Sep-27-2020, 06:34 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Can someone help me solve this programming problem? SuchUmami 6 979 Nov-20-2023, 10:01 AM
Last Post: EdwardMatthew
  A simple problem, how best to solve it? SuchUmami 2 754 Sep-01-2023, 05:36 AM
Last Post: Pedroski55
  python can - general question caslor 0 1,142 Jul-14-2022, 05:21 PM
Last Post: caslor
  How to solve this simple problem? Check if cvs first element is the same in each row? thesquid 2 1,280 Jun-14-2022, 08:35 PM
Last Post: thesquid
  How do I solve the second problem? Cranberry 1 1,157 May-16-2022, 11:56 AM
Last Post: Larz60+
  Problem with "Number List" problem on HackerRank Pnerd 5 2,165 Apr-12-2022, 12:25 AM
Last Post: Pnerd
  a general question barryjo 5 1,561 Feb-01-2022, 10:12 PM
Last Post: Gribouillis
  Try to solve GTG multiplication table problem. Frankduc 6 2,076 Jan-18-2022, 08:26 PM
Last Post: Frankduc
  General Programming Question with Dictionary giddyhead 12 2,827 Jan-10-2022, 10:12 AM
Last Post: Pedroski55
Big Grin General programming question (input string)[ jamie_01 2 1,645 Jan-08-2022, 12:59 AM
Last Post: BashBedlam

Forum Jump:

User Panel Messages

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