Re: [Tutor] Fwd: Re: Loop in pre-defined blocks

2016-06-11 Thread Peter Otten
Alan Gauld via Tutor wrote: > Forwarding to tutor list. Always use Reply All when responding to list > mail. > >> Sorry, to be a little bit more descriptive. I'd like to loop from 1 to 35 >> but within this loop there are divisions which I need to prefix that >> particular division number. > >>

Re: [Tutor] Loop blocks

2016-06-11 Thread cs
On 10Jun2016 22:41, Jignesh Sutar wrote: Is there a better way to code the below than to specify blocks as I have. Ideally I'd like to specify blocks simply as *blocks=(12,20,35)* blocks=[(1,12), (13,20), (25,35)] for i,j in enumerate(blocks): for x in xrange(blocks[i][0],blocks[i][1]+1):