文章来自《Python cookbook》. 翻译仅仅是为了个人学习,其它商业版权纠纷与此无关!
-- Zoom.Quiet [DateTime(2004-08-11T01:21:53Z)] TableOfContents
在索引和序列元素上并行循环
1.14 Looping in Parallel over Index and Sequence Items
Credit: Alex Martelli
问题 Problem
You need to loop on a sequence, but at each step you also need to know what index into the sequence you have reached.
ä½ é%8POST http://wiki.woodpecker.org.cn/moin.cgi/PyCkBk_2d1_2d14 HTTP/1.0 Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, */* Referer: http://wiki.woodpecker.org.cn/moin.cgi/PyCkBk_2d1_2d14 Accept-Language: zh-cn Content-Type: application/x-www-form-urlencoded User-Agent: Mozilla/4.0 (compatible