pop

Removes the last element from a list and returns that element.

This method changes the length of the list. The pop() method works on a list type array, but not on a tuple since tuples are immutable.

This function generates an event.

Function

list.pop()

Arguments

None

Return value

The removed element from the list. A lookup_err() is raised if the list is empty.

Example

This code show an example usage of pop():

(list = [1, 2, 3]).pop();
list;

Return value in JSON format

[
    1,
    2
]