How to remove square brackets from list in Python? [duplicate]
问题 This question already has answers here : Print list without brackets in a single row (11 answers) Closed 3 years ago . LIST = [\'Python\',\'problem\',\'whatever\'] print(LIST) When I run this program I get [Python, problem, whatever] Is it possible to remove that square brackets from output? 回答1: You could convert it to a string instead of printing the list directly: print(", ".join(LIST)) If the elements in the list aren't strings, you can convert them to string using either repr (if you