PyDocs

Nav

Python Runtime Services

list

  • list(iterable=(), /)
Built-in mutable sequence.

If no argument is given, the constructor creates a new empty list.
The argument must be an iterable if specified.
Members of list

a

append
Append object to the end of the list.

c

clear
Remove all items from list.
copy
Return a shallow copy of the list.
count
Return number of occurrences of value.

e

extend
Extend list by appending elements from the iterable.

i

index
Return first index of value.
insert
Insert object before index.

p

pop
Remove and return item at index (default last).

r

remove
Remove first occurrence of value.
reverse
Reverse *IN PLACE*.

s

sort
Sort the list in ascending order and return None.
1 Example
>>> for number in count_to_three():
...     print(number)
0
1
2
3

>>> list(count_to_three())
[0, 1, 2, 3]
from the Python docs
See Also
No see-alsos for builtins/list
0 Notes
No notes for list