Files
calc/help/delete
2017-05-21 15:38:36 -07:00

43 lines
694 B
Plaintext

NAME
delete - delete an element from a list at a specified position
SYNOPSIS
delete(lst, index)
TYPES
lst list
index nonnegative integer less than the size of the list
return type of the deleted element
DESCRIPTION
Deletes element at the specified index from list lst, and returns
the value of this element.
EXAMPLE
> lst = list(2,3,4,5)
list (4 elements, 4 nonzero):
[[0]] = 2
[[1]] = 3
[[2]] = 4
[[3]] = 5
> delete(lst, 2)
4
> print lst
list (3 elements, 3 nonzero):
[[0]] = 2
[[1]] = 3
[[2]] = 5
LIMITS
none
LIBRARY
none
SEE ALSO
append, insert, pop, push, remove, size