Перейти к содержанию

Python list() built-in function

Python list() built-in function

From the Python 3 documentation Rather than being a function, list is actually a mutable sequence type, as documented in Lists and Sequence Types — list, tuple, range.

Examples

>>> l = list()
>>> l
# []
>>> l.append(1)
>>> l.append(2)
>>> l
# [1, 2]