Subscript Notation

Subscript notation (object[key]) is the general syntax for accessing elements in a sequence or mapping using square brackets.

  • Indexing: Access a single element (sequence[index])
  • Slicing: Access a subrange (sequence[start:stop:step])