Categories
Python Answers

How to print list without brackets in a single row with Python?

Spread the love

Sometimes, we want to print list without brackets in a single row with Python.

In this article, we’ll look at how to print list without brackets in a single row with Python.

How to print list without brackets in a single row with Python?

To print list without brackets in a single row with Python, we call join to join the items in the list into one string.

For instance, we write

print(', '.join(names))

to call join with names to combine the items in the names list into 1 string with each item separated by commas.

Conclusion

To print list without brackets in a single row with Python, we call join to join the items in the list into one string.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *