列表索引超出范围:strip

时间:2014-04-10 04:58:07

标签: python indexing

此代码:

f1_in = open("1.csv","r")
f1_dict = {}
for line in f1_in:
    l = line.split()
    f1_dict[l[0].strip()] = l[1].strip()
f1_in.close()

收到错误:

list index out of range at f1_dict[l[0].strip()] = l[1].strip()

0 个答案:

没有答案