【发布时间】:2018-07-05 21:23:22
【问题描述】:
我想打印保存为updated_quotes 的csv 文件的最后13 行。它返回一个语法错误。我怎样才能解决这个问题?
import csv
from collections import deque
with open('updated_quotes', 'r') as csv_file:
csv_reader = csv.reader(csv_file)
def tail(csv_file, n=13):
'Return the last n lines of a file'
print(return deque(open(csv_file), n))
【问题讨论】:
-
"语法错误";具体在哪里?