Skip to content
Advertisement

Print list without brackets in a single row

I have a list in Python e.g.

JavaScript

I want to print the array in a single line without the normal ” []

JavaScript

Will give the output as;

JavaScript

That is not the format I want instead I want it to be like this;

JavaScript

Note: It must be in a single row.

Advertisement

Answer

JavaScript

This, like it sounds, just takes all the elements of the list and joins them with ', '.

Advertisement