list()Easy Examples

Creates a new list or converts an iterable into a list

Basic list() usage

Simple demonstration of the list() built-in function.

python
print(list("hello"))
print(list(range(5)))
print(list((1, 2, 3)))

list() is a built-in function that creates a new list or converts an iterable into a list.

list() with different inputs

Calling list() with various argument types.

python
# More list() examples
print("list() is a Python built-in function")
print(f"Type: {type(list)}")

list() accepts different types of arguments and produces corresponding results.

Want to try these examples interactively?

Open Easy Playground