且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

从CSV移除新行\ n阅读

更新时间:2023-12-03 21:23:16

只需调用

simply call str.strip on each line as you process them:

score=[]

for eachLine in file:
        student = eachLine.strip().split(',')
        score.append(student)
print(score)