6

So right now I have a list of file names. I want to print them without the space after the comma and without quotation marks.

So basically I have a file that has the following output:

['1', '2', '3']

And I want the output to be

1,2,3
wjandrea
  • 28,235
  • 9
  • 60
  • 81
Evilcalamari
  • 83
  • 1
  • 2
  • 6

1 Answers1

10

Use the join method.

>>> your_list = ['1', '2', '3']
>>> print(', '.join(your_list))
1, 2, 3
cs95
  • 379,657
  • 97
  • 704
  • 746