[Solved] How to change this list tuple into list only in Python? [closed]


test = [[(u'hello',), (u'hello',)], [(u'hello',)]]
for i, part_i in enumerate(test):
    for j, part_j in enumerate(part_i):
        test[i][j] = str(part_j[0])

Or, if you prefer the one-line version:

test = [[(u'hello',), (u'hello',)], [(u'hello',)]]
result = [[str(j[0]) for j in i] for i in test]

solved How to change this list tuple into list only in Python? [closed]