Python list() Function
Example
Create a list containing fruit names:
x =
list(('apple', 'banana', 'cherry'))
Try it Yourself »
Definition and Usage
The list()
function creates a list object.
A list object is a collection which is ordered and changeable.
Read more about list in the chapter: Python Lists.
Syntax
list(iterable)
Parameter Values
Parameter | Description |
---|---|
iterable | Optional. A sequence, collection or an iterator object |
Copyright 1999-2023 by Refsnes Data. All Rights Reserved.