Building loop with some exceptions?

Aaron Brady castironpi at gmail.com
Tue Nov 4 14:22:27 EST 2008


On Nov 4, 1:20 pm, Gilles Ganault <nos... at nospam.com> wrote:
> Hello
>
> I need to call a URL through a loop that starts at 01 and ends at 99,
> but some of the steps must be ignored:
>
> =====
> url = "http://www.acme.com/list?code="
> p = re.compile("^(\d+)\t(.+)$")
>
> for i=01 to 99 except 04, 34, 40, 44, 48, 54, 57, 67, 76, 83, 89:

sorted( list( set( domain ) - set( exceptions ) ) )

Set subtraction.



More information about the Python-list mailing list