我在列表中有一个列表,如下所示:
ls = [["Test1\t\t\t\t\tValue1"],["Test2\t\t\t\t\t\t\tValue2"]]
# My current code is
new = [i.split("\t") for i in ls]
print(new)
所需的输出:[[“ Test1”,“ Value1”],[“ Test2”,“ Value2]]
它似乎不起作用,测试1的当前输出显示为[“ Test 1 \ t \ t \ t \ t”,“ Value 1”]。
我正在使用Python v3.8
输出