Python Forum
IndexError: list index out of range
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
IndexError: list index out of range
#5
(Jan-16-2019, 10:53 PM)abdullahali Wrote: Yes sir, my input is 123456789 for example.

>>> '123456789'.split()
['123456789']
>>> '1 2 3 4 5 6 7 8 9'.split()
['1', '2', '3', '4', '5', '6', '7', '8', '9']
>>>
Do you see the problem with your code and the solution for it?

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


Messages In This Thread
RE: IndexError: list index out of range - by nilamo - Jan-16-2019, 10:37 PM
RE: IndexError: list index out of range - by buran - Jan-17-2019, 07:54 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to fix list index out of range longmen 26 6,115 Apr-27-2022, 05:46 PM
Last Post: deanhystad
  list index out of range OliverG 3 2,361 Sep-03-2021, 12:04 AM
Last Post: itsmycode
  Index List a04j 2 2,941 Jul-10-2021, 01:14 PM
Last Post: BashBedlam
  List index out of range when turning CSV into dict ranbarr 15 6,505 May-12-2021, 10:38 AM
Last Post: ranbarr
  List vs index: Frederico_Caldas 5 3,631 Jul-03-2020, 10:55 AM
Last Post: DeaD_EyE
  To find the index of the first occurrence of the key in the provided list Angry_bird89 4 3,293 Jun-20-2020, 06:53 PM
Last Post: Angry_bird89
  list index out of range mcgrim 2 2,929 May-25-2019, 07:44 PM
Last Post: mcgrim
  String index out of range felie04 2 5,559 Aug-17-2018, 11:18 PM
Last Post: felie04
  Accessing data in zip - Index out of range pythoneer 24 12,870 Mar-15-2018, 06:19 PM
Last Post: buran
  "List index out of range" for output values pegn305 3 5,329 Nov-26-2017, 02:20 PM
Last Post: heiner55

Forum Jump:

User Panel Messages

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