Skip to content

pop

Syntax

pop(list-variable)

Parameters

list-variable
the name of a list variable.

Description

Removes the last element from the list. The element that was removed is returned.

It is an error for pop to be performed on an empty list.

Examples

my_list = list(1,2,3)
pop(my_list)                    # "my_list" now has the value [1,2]
my_numeric = pop(my_list)       # "my_list" is now [1] and "my_numeric" is 2

See Also