Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
String out of range error
#2
1) make sure to use code tags
2) make sure to input all of the traceback. This is required to find the error amongst your code. 
3) make sure after you post code that it is formatted correctly. As is the indentation is missing. MAke sure you are using spaces VS tabs.
4) give an example of the function arguments. Currently the variable "their_history" could be anything...which could make a splicing of it out of range. This code requires your string to be at least 2 characters long which causing out of range
Quote:
their_history[-2]
Recommended Tutorials:
Reply


Messages In This Thread
String index out of range - by Salah71 - Jan-17-2017, 06:37 PM
RE: String out of range error - by micseydel - Jan-18-2017, 06:58 PM
RE: String out of range error - by Salah71 - Jan-18-2017, 07:38 PM
RE: String out of range error - by micseydel - Jan-18-2017, 07:46 PM
RE: String out of range error - by Salah71 - Jan-18-2017, 09:11 PM
RE: String out of range error - by metulburr - Jan-18-2017, 08:42 PM
RE: String index out of range - by metulburr - Jan-17-2017, 07:08 PM
RE: String index out of range - by Salah71 - Jan-17-2017, 07:19 PM
RE: String index out of range - by snippsat - Jan-17-2017, 09:19 PM
RE: String index out of range - by Salah71 - Jan-18-2017, 04:15 AM
String out of range error - by Salah71 - Jan-18-2017, 04:21 AM
String Index out of range error - by Salah71 - Jan-18-2017, 05:36 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  I'm getting a String index out of range error debian77 7 2,428 Jun-26-2022, 09:50 AM
Last Post: deanhystad
  matplotlib x axis range goes over the set range Pedroski55 5 3,328 Nov-21-2021, 08:40 AM
Last Post: paul18fr
  Python Error List Index Out of Range abhi1vaishnav 3 2,412 Sep-03-2021, 08:40 PM
Last Post: abhi1vaishnav
  python error: bad character range \|-t at position 12 faustineaiden 0 3,743 May-28-2021, 09:38 AM
Last Post: faustineaiden
  string index out of range jade_kim 4 2,697 Jan-13-2021, 05:41 AM
Last Post: jade_kim
  List index out of range error while accessing 2 lists in python K11 2 2,177 Sep-29-2020, 05:24 AM
Last Post: K11
  List index out of range error when attempting to make a basic shift code djwilson0495 4 3,083 Aug-16-2020, 08:56 PM
Last Post: deanhystad
  String index out of range - help please DudleyDiccle 7 3,514 Mar-27-2020, 12:10 AM
Last Post: DudleyDiccle
  Define a range, return all numbers of range that are NOT in csv data KiNeMs 18 7,270 Jan-24-2020, 06:19 AM
Last Post: KiNeMs
  IndexError: string index out of range ? Q_Y 5 4,797 Jul-05-2019, 07:18 PM
Last Post: noisefloor

Forum Jump:

User Panel Messages

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