How to convert list containing string of elemet to list in python [closed]

You can do it in a list comprehension:

res=['QA9.1', 'QA4,QA12,QA15,QA16', 'QA9.1']
res1 = [x for a in res for x in a.split(',')]
print(res1)

Leave a Comment