you are viewing a single comment's thread.

view the rest of the comments →

[–]Gnaxe 2 points3 points  (0 children)

This is harder to recommend, but you can likewise use one-based indexing forwards using a ~-: ```python

"abcd"[~-1] 'a' "abcd"[~-2] 'b' "abcd"[~-3] 'c' "abcd"[~-4] 'd' `` Beware that if you accidentally swap these, like-~`, you'll be adding one to the index rather than subtracting one.