On 6/08/21 12:00 pm, Jack Brandom wrote:
It seems that I'd begin at position 3 (that's "k" which I save somewhere), then I subtract 1 from 3, getting 2 (that's "c", which I save somewhere), then I subtract 1 from 2, getting 1 (that's "a", ...), then I subtract 1 from 1, getting 0 (that's J, ...), so I got "kcaJ" but my counter is 0 not -13, which was my stopping point.
You need to first replace any negative or missing indices with equivalent indices measured from the start of the string. When you do that in this example, you end up iterating backwards from 3 and stopping at -1. -- Greg -- https://mail.python.org/mailman/listinfo/python-list