import os
import csv
infile = open("PearsonFebruary2012.csv","rb")
reader = csv.reader(infile)
for i in range(0.17):
reader.next()
#The reader below this one
print reader.next()
#I am getting the error that reader is an invalid syntax.
答案 0 :(得分:1)
看起来你有一个错字。您的0.17
应为0,17
。
Marijn正确地指出存在两个问题,因为使用float作为range
的参数会生成TypeError
。