Can someone please hint my mistake. Im trying to remove numbers from the string. Findall succefully finds the number but replace does not replace them with empty string. here is the code:
import re
x = 'John2345 can5 code with python3'
extra = re.findall('\d{1,9}', x)
x.replace(extra, '')
x
and here is the error:
TypeError Traceback (most recent call last)
<ipython-input-334-bfc161d88f65> in <module>()
2 x = 'ererf ergg5 erg 545 eeg'
3 extra = re.findall('\d{1,9}', x)
----> 4 x.replace(extra, '')
5 x
TypeError: Can't convert 'list' object to str implicitly
Cheers, Sia