list problem

Simon Forman rogue_pedro at yahoo.com
Wed Jul 26 00:40:19 EDT 2006


Simon Forman wrote:
> Finally, you can say:
>
> for i in xrange(1,10):
>     s = "XXX1%04i" % i
>     if s not in list1 and s not in list2:
>         print s
>
> HTH,
> ~Simon

D'oh!  Forgot to break.

for i in xrange(1,10):
    s = "XXX1%04i" % i
    if s not in list1 and s not in list2:
        print s
        break

Peace,
~Simon




More information about the Python-list mailing list