If you want a list from any iterable in Python, the Python list function is what you need. It takes a string, tuple, set, dict or generator and gives you back a list.
print(list("NYC"))
# ['N', 'Y', 'C']
In this tutorial, I’ll cover list() with six short examples you’ll actually use. Every output comes from Python 3.12.5 in Command Prompt.
Python list() Syntax
list(iterable=(), /)
| Parameter | Required | Default | Description |
|---|---|---|---|
iterable | No | () | Any iterable (positional only) |
Return value: a new list with the same items in the same order. With no argument, you get [].
Note: the / means you can’t write iterable=. Other ways to build lists: how to create a list in Python.
When to Use list() in Python
- Turning a tuple or set into something you can change
- Grabbing dictionary keys, values or pairs
- Making a quick shallow copy of a list
- Seeing everything a range, map, zip or generator produces
Exporting rows to a CSV file for Excel? Creating an empty list in Python is the usual first step.
Example 1: Convert a String to a List of Characters
Let me start with a US city name:
city = "Austin"
print(list(city))
print(list())
print(list(""))
Output:
['A', 'u', 's', 't', 'i', 'n']
[]
[]

How does this work? Python walked the string one character at a time. An empty call returned [].
To split by words instead, read converting a string to a list in Python.
Example 2: Convert a Tuple or Set to a List in Python
Tuples can’t change, and sets have no order:
prices = (19.99, 4.5, 120.0)
zip_codes = {78701, 10001, 60601}
price_list = list(prices)
price_list.append(7.25)
print(price_list)
print(sorted(list(zip_codes)))
Output:
[19.99, 4.5, 120.0, 7.25]
[10001, 60601, 78701]
How does this work? The tuple became a list, so append() worked. Sets have no order, so I added sorted().
More on sets: converting a set to a list.
Example 3: Get Dictionary Keys, Values and Items as a List
Here’s an inventory dictionary:
stock = {"SKU-101": 12, "SKU-205": 0, "SKU-310": 48}
print(list(stock))
print(list(stock.values()))
print(list(stock.items()))
Output:
['SKU-101', 'SKU-205', 'SKU-310']
[12, 0, 48]
[('SKU-101', 12), ('SKU-205', 0), ('SKU-310', 48)]

How does this work? A dict loops over keys, so you got the SKUs. .items() gave (key, value) tuples.
See converting a dictionary to a list and the Python dict() function.
Example 4: Copy a List with list()
Passing a list makes a copy:
orders = ["Denver", "Boston", ["Miami", "Tampa"]]
backup = list(orders)
backup[0] = "Seattle"
backup[2].append("Orlando")
print(orders)
print(backup)
print(backup is orders)
Output:
['Denver', 'Boston', ['Miami', 'Tampa', 'Orlando']]
['Seattle', 'Boston', ['Miami', 'Tampa', 'Orlando']]
False

How does this work? Changing backup[0] left orders alone, but the inner list is shared, so "Orlando" showed up in both.
Pro Tip: for nested data, use copy.deepcopy(); see shallow copy vs deep copy in Python.
Example 5: Convert range, map and zip Objects to a List
These return lazy objects:
states = ["tx", "ca", "ny"]
sales = [1250, 980, 1430]
print(list(range(2020, 2027, 2)))
print(list(map(str.upper, states)))
print(list(zip(states, sales)))
Output:
[2020, 2022, 2024, 2026]
['TX', 'CA', 'NY']
[('tx', 1250), ('ca', 980), ('ny', 1430)]
How does this work? list() pulled every value: map() uppercased states, zip() paired them with sales.
Learn more in the Python zip() function and enumerate() in Python.
Example 6: How Do I Convert a Generator to a List in Python?
Generators can only be read once:
readings = [71.2, 68.9, 74.5, 80.1]
hot = (r for r in readings if r > 70)
print(list(hot))
print(list(hot))
Output:
[71.2, 74.5, 80.1]
[]

How does this work? The first call collected readings above 70. The generator was then used up, so the second returned [].
A list comprehension in Python does the same filter in one step.
Common Mistakes with Python list()
These are the Python list() errors I see most:
def m1(): return list(2026)
def m2(): return list("a", "b")
def m3(): return list(iterable="abc")
def m4():
list = ["Reno"]
return list("abc")
for n, test in enumerate([m1, m2, m3, m4], 1):
try:
test()
except TypeError as err:
print(f"{n}. TypeError: {err}")
Output:
1. TypeError: 'int' object is not iterable
2. TypeError: list expected at most 1 argument, got 2
3. TypeError: list() takes no keyword arguments
4. TypeError: 'list' object is not callable

- Use
[2026]for one number. - Pass one iterable.
- Drop the keyword.
- Rename your
listvariable.
Fixes for the last one: list object is not callable in Python.
Wrapping Up the Python list() Function
Python’s list() function turns strings, tuples, sets, dicts and iterators into a fresh list. It also makes shallow copies.
Next, browse more Python built-in functions and methods.
For more list practice, try these:
What People Ask About Python list() Function
Is list() a function or a class in Python?
It’s a class. Calling list() creates a new list object.
Can list() convert a number to a list of digits?
Not directly. Use list(str(2026)), then int() on each item.
Does list() remove duplicates?
No. Use list(set(items)), but that loses the order.
Where can I read the full list() reference?
The signature and copy rules are in list() in the Python docs.

Bijay Kumar is a 13-time Microsoft MVP with more than 18 years in software development, and the founder of Python Guides and TSinfo Technologies. He started out building .NET and SharePoint solutions at HP, TCS and KPIT before moving into Python, machine learning and AI, and he also builds web apps with TypeScript and React. He writes the tutorials here himself, and every example is run before publishing so you see the real output. More about Bijay · Microsoft MVP profile · LinkedIn