On Mar 30, 2007, at 5:42 PM, Michael Bentley wrote:
> for i in yourstring.split():
>       if i[0].isdigit():
>               yourstring = yourstring.replace(i, '-%s' % (i,), 1)

*OR*

yourstring ' '.join(x[0].isdigit() and '-%s' % x or x for x in  
yourstring.split())

;-)


-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to