5

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
  • 23,210
  • 7
  • 49
  • 68
Evilcalamari
  • 73
  • 2
  • 6

1 Answers1

8

Use the join method.

>>> your_list = ['1', '2', '3']
>>> print(', '.join(your_list))
1, 2, 3
cs95
  • 330,695
  • 80
  • 606
  • 657