"John Fouhy" <j...@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

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to