Python – Creates List – list() Function – Examples & Explanation

list() function is used to find the constructor creates a list in Python in Python for the given input.

list() function is a part of Python Built-in Functions.

Syntax of list() Function

The syntax of list() function in Python is:

list([iterable])

 

Parameters of list() Function in Python

x – Where x is any valid . This parameter is required.

 

Compatibility

list() function is available and compatible with both Python 2.x and 3.x.

 

Return Value of list() Function in Python

list() function returns constructor creates a list in Python for the given input.

 

Python list() Function Example 1

Example CODE

Output:

 

Python list() Function Example 2

Example CODE

Output: