Duncan Smith <[EMAIL PROTECTED]> wrote:

> [EMAIL PROTECTED] wrote:
> > Zipping an xrange? I'm having trouble visualizing how you do that to
> > avoid x*i+y.
> > 
> > -Janto
> > 
> 
> Something like,
> 
> >>> lis =  ['a', 'b', 'c', 'd']
> >>> y = 3
> >>> i = 7
> >>> for n, item in zip(xrange(y, len(lis)*i+y, i), lis):
>       print n, item

Actually I tend to use sys.maxint as the xrange's middle arg, but, yes,
this IS the general idea!-)


Alex
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to