Function Details: list

Description


Built-in mutable sequence.


Extended Description


The list() function creates a list object. If no argument is given, it creates a new empty list. If an argument is given, it creates a list consisting of the items in the iterable. Changes to a list can affect other variables, and list operations have side effects.


Read More about list from Python Documentation

Function Signature


list(iterable: Optional[Iterable] = None) -> list

Module: builtins

Class: list

Parameters



Parameter List


  • iterable: Optional[Iterable]

Return


Returns a new list object.


Return Type


list

Output

Explanation

This example demonstrates creating lists from various types of iterables.