def main():
my_list = [[float(i) for i in line.split(',')] for line in open("Alpha.txt")]
print(my_list)
for elem in my_list:
listA=[]
listA = elem
print(listA)
main()
此代码打印出我正在寻找的正确数据,但是我需要将 for 循环中的每个打印设置为一个对象。关于我将如何去做的任何帮助?
[1.2, 4.3, 7.0, 0.0]
[3.0, 5.0, 8.2, 9.0]
[4.0, 3.0, 8.0, 5.6]
[8.0, 4.0, 3.0, 7.4]