【发布时间】:2020-12-14 17:01:13
【问题描述】:
我有这种形式的列表:
[[('1st',), ('2nd',), ('5th',)], [('1st',)]]
我想把它转换成:
[['1st', '2nd', '5th'], ['1st']]
我试过这个:
res = [list(ele) for ele in racer_placement for ele in ele]
但是我得到的结果:
[['1st'], ['2nd'], ['5th'], ['1st']]
【问题讨论】:
-
这能回答你的问题吗? Convert tuple to list and back