一个“成绩.CSV”文件(用“记事本”打开)如下:
王鑫,86,90,92,99,94,95
杨小虹,93,97,95,90,86,85
李静,89,98,99,94,90,85
下面程序执行结果是?( )
f=open('成绩.CSV','r') a=[] for i in f: a.append(i.strip().split(',')) f.close() print(a)
[['王鑫', '86', '90', '92', '99', '94', '95'], ['杨小虹', '93', '97', '95', '90', '86', '85'], ['李静', '89', '98', '99', '94', '90', '85']]
[['王鑫', '86', '90', '92', '99', '94', '95\n'], ['杨小虹', '93', '97', '95', '90', '86', '85\n'], ['李静', '89', '98', '99', '94', '90', '85\n']]
[['王鑫,86,90,92,99,94,95'], ['杨小虹,93,97,95,90,86,85'], ['李静,89,98,99,94,90,85']]
['王鑫,86,90,92,99,94,95\n', '杨小虹,93,97,95,90,86,85\n', '李静,89,98,99,94,90,85\n']