Simon Forman: > I originally meant this as a joke and was going to say not to use it. > But on my old, slow computer it only takes about a second or two.
Another possibility, still using a filter: nodig = set("06789") r = [i for i in xrange(11111, 55555+1) if not (set(`i`) & nodig)] Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list