THE WORLD'S LARGEST WEB DEVELOPER SITE

Python list() Function

❮ Built-in Functions


Example

Create a list containing fruit names:

x = list(('apple', 'banana', 'cherry'))
Run example »

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 Required. A sequence, collection or an iterator object

❮ Built-in Functions