dee dee
dee dee

Reputation: 27

individual string list to list of string

I have a text output that has individual list,this format ['a']['b']['c'] and so on and I want to convert this list into a string put in a list, in this format ['a','b','c'].The end goal is to create a new column and append this list of strings to rows in a column.

Upvotes: 1

Views: 45

Answers (1)

User12
User12

Reputation: 148

You can join the lists like this:

list_item = [['a'], ['b'], ['c']]
result = []
for i in list_item:
    result.append(i[0])

print(result)

The result will be this:

['a', 'b', 'c']

Upvotes: 1

Related Questions