0
追加一个列表,使用列表解析列表的列表,我会很感激如果你coould帮我这个:在Python 3.6
我有文件,我阅读和分析它的线。此行是一个字符串列表,我改变这些字符串彩车,然后,我花车该列表追加到列表中的另一列表,以便我的代码看起来是这样的:
for line in file:
#parsing code...
[lista_flot.append(float(number)) for number in line]
lecturas.append(lista_flot)
,但我想知道如果有与列表内涵一行追加这些名单,使它像这样的一种方式:
for line in file:
#parsin code...
lecturas.append([lista_flot.append(float(number)) for number in line])
还有,为什么当我做一行的所有值转向诺内斯?
非常感谢!