On Fri, 21 Jan 2005 12:37:46 +0000, Simon Brunning
<[EMAIL PROTECTED]> wrote:
> This what you want?
> 
> >>> import re
> >>> test = ["a1", "a2", "a3"]
> >>> test = [re.sub("[a-z]", "", item) for item in test]
> >>> test
> ['1', '2', '3']

Or, if you *must* use map, you can do:

>>> test = map(lambda item: re.sub("[a-z]", "", item), test)
>>> test
['1', '2', '3']

I much prefer the first list comprehension form myself, but reasonable
men can differ...

-- 
Cheers,
Simon B,
[EMAIL PROTECTED],
http://www.brunningonline.net/simon/blog/
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to