[Tutor] Reading a Text File with tkFileDialog, askopenfilename+enumerate

Alan Gauld alan.gauld at btinternet.com
Mon Feb 16 01:19:24 CET 2009


"John Fouhy" <john at fouhy.net> wrote 

>> for index, item in [9,8,7,6]:
>>  print index, item
>>
>> 0 9
>> 1 8
>> 2 7
>> 3 6
> 
> You mean:
> 
> for index, item in enumerate([9,8,7,6]):
> print index, item

Oops, yes, thanks for catching that. It was fairly 
fundamental to the discussion!

Alan G



More information about the Tutor mailing list