Skip to main content
The 2026 Annual Developer Survey is live— take the Survey today!

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

6
  • 73
    Don't use list as a variable name, it's the name of a standard class. Commented Apr 15, 2019 at 16:22
  • 10
    It isn't starting at 1, it's starting at -1. ?!? Commented Apr 15, 2019 at 20:21
  • 7
    mod arithmetic should really be mentioned on this page somewhere... Commented Apr 16, 2019 at 0:14
  • 6
    Should that say as opposed to -0? Since it starts at 0 when indexing from the start, it is trivial that it can't be 0 from the end, so I think -0 is what is meant. Commented Apr 16, 2019 at 9:30
  • 2
    Did you try accessing index 0? Commented Apr 16, 2019 at 14:30

lang-py