There's got to be an easy way to do this (fwd)

William Park opengeometry at yahoo.ca
Thu Jul 5 18:01:54 EDT 2001


On Thu, Jul 05, 2001 at 05:42:00PM -0400, Lulu of the Lotus-Eaters wrote:
>   def traditional(iters):
>       for i in iters:
>           result = ""
>           for c in '(123)/456-7890':
>               if c in digits:
>                   result = result + c

Sorry to jump in the middle of thread (can't access newgroup at the
moment).  Have you tried this one.

    def traditional(iters):
        for i in iters:
	    result = []
	    for c in '(123)/456-7890':
	        if c in digits:
		    result.append(c)
	    "".join(result)

-- 
William Park, Open Geometry Consulting, <opengeometry at yahoo.ca>
8 CPUs cluster, (Slackware) Linux, Python, LaTeX, Vim, Mutt, Sc.




More information about the Python-list mailing list