Skip to main content
Sorted collections library.

Types

SortedList

type List that holds values in sorted order.

Methods

__init__
(lst) -> None
Class constructor (initializer for the data type).
add
(value) -> None
Adds given value to the list.
remove
(x) -> None
Removes given value from the list.
__getitem__
(i) -> float
Returns list element at given index.
Method __getitem__ should never be called directly, instead list_obj[key] syntax should be used.
__len__
() -> int
Returns the length (the number of items) of a list.
Method __len__ should never be called directly, instead len(list_obj) syntax should be used.
__contains__
(x) -> bool
Returns True if the list contains the given value, otherwise False.
Method __contains__ should never be called directly, instead val in lst syntax should be used.

I