[Tutor] iterating data and populating a dictionary

Alan Gauld alan.gauld at btinternet.com
Tue Aug 5 22:42:59 CEST 2008


"Alan Gauld" <alan.gauld at btinternet.com> wrote 

>>             index = float(the_line[-1])
>>             dif_index = index - start_index
>>             iindex[field] = dif_index
> 
> Here index is assigned to a floating point number.
> Then it is indexed. Floats don't have indexes...

Just noticed the indexed variable has a double i so not 
the same. Might be better to pick a more descriptive 
name though! :-)

Alan G.



More information about the Tutor mailing list