secondlast
Secondlast is a term used to describe the second-to-last element in a finite sequence. It is synonymous with the penultimate element, though penultimate is more common in formal mathematical writing; secondlast appears in casual language and in programming contexts as a practical label or function name.
For a sequence x1, x2, ..., xn with n >= 2, the secondlast is x_{n-1}. In everyday language
In programming, secondlast is often obtained by indexing from the end. Languages with negative indices allow
Examples help illustrate the concept. The list [3, 7, 2, 9] has a secondlast element equal to
Ambiguities arise when the sequence contains fewer than two elements; in such cases the secondlast may be
See also: penultimate, last, second-to-last, antepenultimate. The term secondlast often appears as a variable name or