Notes

Source: 📖 Problem Solving with Algorithms and Data Structures using Python 14.20

Date: 2021-10-29


Operations of an unordered list

  • add() adds a new item to the list.
  • remove(item) removes the item from the list and returns it.
  • search(item) searches if the item exists in the list and returns a boolean value.
  • is_empty() is a boolean function to check it the list is empty.
  • size() returns the number of items in the list.
  • append(item) adds a new item to the end of the list.
  • index(item) returns the index value of the item in the list.
  • insert(pos, item) inserts an item at the provided index position, altering the index values of all subsequent items.
  • pop() removes and returns the last item in the list.
  • pop(pos) removes and returns the item at the provided positional index, altering the index values of all subsequent items.

See also: