Macaulay2 » Documentation
Packages » Macaulay2Doc » The Macaulay2 language » lists and sequences » VisibleList _ ZZ
next | previous | forward | backward | up | index | toc

# VisibleList _ ZZ -- get element from list

- Operator: _
- Usage:
    `x_i`
- Inputs:
  - x, a visible list
  - i, an integer
- Outputs:
  - the i-th element of the list x

## Description

The entries of the list, sequence or array are numbered starting with 0. If i is negative, then the i-th entry counting from the end is provided. If i is out of range, an error is signaled.

    i1 : x = a..t

    o1 = (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t)

    o1 : Sequence

    i2 : #x

    o2 = 20

    i3 : x_-1, x_19, x_0

    o3 = (t, t, a)

    o3 : Sequence

## Caveat

Lists are immutable objects, i.e. you cannot assign to them. See MutableList for lists that you may modify.

## See also

- BasicList # ZZ -- get value from list, hash table, database, dictionary, or string

## Ways to use this method:

- VisibleList _ ZZ -- get element from list

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/Macaulay2Doc/operators/underscore.m2:49:0.