O'Reilly logo
  • Sri Harsha V thinks this is interesting:

Indexing (S[i]) fetches components at offsets:
  • The first item is at offset 0.

  • Negative indexes mean to count backward from the end or right.

  • S[0] fetches the first item.

  • S[−2] fetches the second item from the end (like S[len(S)−2]).



Cover of Learning Python, 5th Edition


A short summary on indexing and slicing. Useful for a quick glance to revise these concepts.