Menu Close

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

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.

Posted in Python, Python Answers