2017-10-21 206 views

回答

0
import csv 

total = 0 
with open("file_with_three_lines.csv") as file: 
    for row in csv.reader(file, delimiter=','): 
     for col in row: 
      total += int(col) 

像这样的东西可以工作,如果你知道文件中只有数字。