Friday, 23 August 2013

I need proper sintax for re.sub

I need proper sintax for re.sub

I need to go through strings in a list "listb", replacing the character
"<" with "*".
I tried like this:
import re
for i in listb:
i = re.sub('\<','\*', 0)
But I keep getting TypeError: expected string or buffer.
Not sure what am I doing wrong and examples on the net were not much help.

No comments:

Post a Comment