Python list() Function Syntax

Syntax: list(iterable)

Parameter:

  • iterable:  an object that could be a sequence (string, tuples) or collection (set, dictionary) or any iterator object.

Note: If we don’t pass any parameter then the list() function will return a list with zero elements (empty list).

Python list() Function

Python list() function takes any iterable as a parameter and returns a list. In Python iterable is the object you can iterate over. Some examples of iterables are tuples, strings, and lists.

Similar Reads

Python list() Function Syntax

Syntax: list(iterable) Parameter: iterable:  an object that could be a sequence (string, tuples) or collection (set, dictionary) or any iterator object....

list() Function in Python

We can create a Python list by using list() function. Below are the ways by which we can use list() function in Python:...