Explore

Close
Python Programs Share

Remove Brackets And Commas From List In Python

Remove Brackets And Commas From List In Python

Want to know how to remove brackets and commas from list in python, then you are at the right place today in this tutorial. I will show you how to remove brackets and commas from list in python.

When I say removing brackets and commas from list in python I mean when we print a list in python it prints it with bracket and commas below is a example.


numbers = ["one","two","three"]

print(numbers)

# Output
["one","two","three"]

# Output we want without brackets and commas
one two three 

First output is the normal output which python prints and second output is the one which I will show you how to get in this tutorial so follow till the end.

Program To Remove Brackets And Commas From List In Python


fruits_list = ["Apple","Banana","Papaya","Grapes"]

new_fruits_list = ' '.join(fruits_list)

print(new_fruits_list)

Above is the program to remove brackets and commas from list in python. Now to run this program you need to have python installed on your computer, If you don’t have then follow this guide: Install and setup python on your computer.

To run this python program, follow the below steps:

  • Create a new folder for this python project.
  • Open it in a code editor of your choice.
  • Create a python file with an ending .py extension.
  • Copy the above code and paste it in your file.
  • Open a terminal or CMD at folder location
  • And type this command python filename.py (Name of your file).

After running this program you will see that it printed the list without brackets and commas below is an example output of the above program.


Apple Banana Papaya Grapes

As you can see we successfully created this program in python. Don’t want to create all the files and folders then you can run this program now using this online python compiler.

Summary

This was a simple program remove brackets and commas from list in python. I hope you found this tutorial helpful and useful. Do share this tutorial with your friends who might need this program.

Here are some more python program tutorials for you:

I hope you found what you were looking for from this tutorial, and if you want more python programs and tutorials like this, do join our Telegram channel for future updates.

Thanks for reading, have a nice day 🙂