multiple ranges to for statement?

Ian Bicking ianb at colorstudy.com
Tue Apr 9 02:44:20 EDT 2002


On Tue, 2002-04-09 at 01:33, Damian Menscher wrote:
> I'm hoping to do something along the lines of:
> 
> for i in range(a,b),range(c,d):
>     stuff goes here

Most simply:

for i in range(a, b) + range(c, d):
    ...


--Ian







More information about the Python-list mailing list