IndexError: string index out of range
<p>Line 6 of this code produces a "IndexError: string index out of range". I assume that when I ask "if line[6] != None" there is no content in the line, but I can not figure out why. I have also tried using !='', but the problem is before that. </p>

<pre><code>import csv
dict1={} 
list1 = csv.reader(open('014850_D_AA_20070207.txt'), delimiter='\t')
list1.next()    # skips the headers
for line in list1:
    if line[6] != None:
        dict1[line[0]]= (line[6] + ", " + line[11])
    else:
        continue    
print dict1
</code></pre>
