Print list without brackets in a single row

784    Asked by yashJaiteley in Python , Asked on Apr 13, 2021

I have a list in Python e.g.

letters = ["t", "h", "e"]
I want to print the array in a single line without the normal " []
names = ["t", "h", "e"]
print (letters)
Will give the output as;
["t", "h", "e"]
That is not the format I want instead I want it to be like this;
t, h, e

Note: It must be in a single row.

Answered by Mohit Choudhary

Try the code given below to solve the print list without brackets python, all the elements will be separated with a comma.

name= [“t”,”h”,”e”]
Print ( ‘,’ .join(name))
Output:- t,h,e

Your Answer

Interviews

Parent Categories