Re: A prettier solution

Guido.van.Rossum@cwi.nl
Tue, 19 Apr 1994 10:49:46 +0200

> a=range(margin)
> a.remove(shift)
> for i in a:
> .......

If you know 0 <= shift <= margin, concatenating two ranges is slightly
more elegant (though perhaps not faster):

for i in range(shift) + range(shift+1, margin):
...

--Guido van Rossum, CWI, Amsterdam <Guido.van.Rossum@cwi.nl>
URL: <http://www.cwi.nl/cwi/people/Guido.van.Rossum.html>