Next / Previous / Contents / TCC Help System / NM Tech homepage

20.23. list(): Convert to a list

This function creates a new list. The argument x may be any iterable (see Section 19.2, “What is an iterable?”).

>>> list(('Bentham', 'Locke', 'Hobbes'))
['Bentham', 'Locke', 'Hobbes']
>>> list("Bruce")
['B', 'r', 'u', 'c', 'e']
>>> list((42,))
[42]
>>> list()
[]