VOOZH about

URL: https://www.geeksforgeeks.org/python/list-constructor-in-python/

⇱ list() constructor in Python - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

list() constructor in Python

Last Updated : 23 Jul, 2025

In Python list() constructor is a built-in function which construct a list object. We can use list constructor to create an empty list or convert an iterable (dictionary, tuple, string etc.) to a list.


Output
[] <class 'list'>
[1, 2, 3] <class 'list'>
['G', 'f', 'G'] <class 'list'>


Syntax of list()

list([iterable])

We can pass optional argument to list() as iterable. If no iterable is provided, it returns an empty list.


Use of list() constructor

As discussed above, we can create an empty list or convert any iterable to list using list() constructor. Let's see some more examples.



Output
[0, 1, 2]
[0, 1, 4, 9, 16]


Creating Nested List with list() constructor


Shallow copy of List using list()



Comment
Article Tags:
Article Tags: