As a Python developer, I often find myself needing to format lists for better readability or presentation. I encountered this scenario while working on a data analysis project. In this tutorial, I will share various methods to remove brackets from list in Python with suitable examples and screenshots.
Remove Brackets From List in Python
Before getting into the methods, let’s briefly discuss what lists are in Python. A list is a collection of items that can be of different data types. They are defined by square brackets, like so:
my_list = [1, 2, 3, 'apple', 'banana']When printed, lists display their elements along with the brackets and commas, as shown below:
print(my_list) # Output: [1, 2, 3, 'apple', 'banana']While this format is useful for debugging, it may not be ideal for presentation. Let’s explore how to remove those brackets.
Read Is Python a Compiled Language?
Method 1: Use the join() Function
One of the simplest ways to remove brackets is by converting the list to a string using the Python join() method. This method works well for lists containing strings. Here’s how to do it:
Example:
my_list = ['apple', 'banana', 'cherry']
formatted_string = ', '.join(my_list)
print(formatted_string) Output:
apple, banana, cherryYou can see the output in the screenshot below.

Steps:
- Use the
join()method on a string that will separate the elements (e.g.,', '). - Pass the list as an argument to
join().
Advantages:
- Easy to implement.
- Customizable separators.
Check out How to Convert Letters to Numbers in Python?
Method 2: Use List Comprehension
If you want to format a list containing mixed data types (like integers and strings), you can use Python list comprehension to convert all elements to strings first.
Example:
my_list = [1, 2, 3, 'apple', 'banana']
formatted_string = ', '.join(str(item) for item in my_list)
print(formatted_string) Output:
1, 2, 3, apple, bananaYou can see the output in the screenshot below.

Steps:
- Use a generator expression inside the
join()method. - Convert each item to a string using
str(item).
Advantages:
- Works with mixed data types.
- Retains the order of elements.
Read How to Pad Numbers with Leading Zeros in Python?
Method 3: Use the str() Function
Another simple method is to convert the entire list to a string and then remove the brackets. This can be done using the Python str() function and string slicing.
Example:
my_list = [1, 2, 3, 'apple', 'banana']
formatted_string = str(my_list)[1:-1] # Remove first and last character
print(formatted_string) Output:
1, 2, 3, 'apple', 'banana'You can see the output in the screenshot below.

Steps:
- Convert the list to a string using
str(). - Use slicing to remove the first and last characters.
Advantages:
- Quick and easy for simple lists.
- Minimal code required.
Check out How to Check if Input is a Number in Python?
Method 4: Use the itertools.chain Method
For those who prefer a more programmatic approach, you can utilize the itertools module, specifically the chain function in Python, to flatten the list and remove brackets.
Example:
import itertools
my_list = [1, 2, 3, 'apple', 'banana']
formatted_string = ', '.join(itertools.chain(my_list))
print(formatted_string) # Output: 1, 2, 3, apple, bananaSteps:
- Import the
itertoolsmodule. - Use
itertools.chain()to flatten the list and then join the elements.
Advantages:
- Useful for nested lists.
- More control over complex data structures.
Read What are Floating Point Numbers in Python?
Conclusion
In this tutorial, I have explained how to remove brackets from list in Python. I discussed four important methods to accomplish this task, such as using the join() function, using list comprehension , using str() function and using the itertools.chain method.
You may like to read:
- How to Check if a String is Alphabet in Python?
- How to Split a Number into Digits in Python?
- How to Count the Number of Digits in a Number in Python?

I am Bijay Kumar, a Microsoft MVP in SharePoint. Apart from SharePoint, I started working on Python, Machine learning, and artificial intelligence for the last 5 years. During this time I got expertise in various Python libraries also like Tkinter, Pandas, NumPy, Turtle, Django, Matplotlib, Tensorflow, Scipy, Scikit-Learn, etc… for various clients in the United States, Canada, the United Kingdom, Australia, New Zealand, etc. Check out my profile.