The elements of a sequence have indices beginning at 0 in Xcas mode and 1 in other modes (see Section 3.5.2).
You can get the an element of index n of a sequence or list by following
the sequence or list with [n] (see Section 5.3.4).
(Note that head(S) does the same thing as S[0].)
Examples.
3 |
S := 2,3,4,5 |
S[2] |
4 |
C |
For lists, the at command can also be used to get the element at a specific position.
Note. at cannot be used for sequences, since the second argument would be merged with the sequence.
Example.
Input:
or:
Output: