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.