Help newbie!
Fernando Pérez
fperez528 at yahoo.com
Mon Dec 10 20:37:39 EST 2001
Oleg Broytmann wrote:
> On Tue, Dec 11, 2001 at 03:14:35PM +2328, Fernando P?rez wrote:
>> No need to import anything:
>> new_string = 'hello'.replace('hel','hol')
>
>>>> new_string = 'hello'.replace('hel','hol')
> Traceback (innermost last):
> File "<stdin>", line 1, in ?
> AttributeError: 'string' object has no attribute 'replace'
>
> (Python 1.5.2, of course).
Ah. Oh well, then just import string or upgrade if it makes sense to.
Cheers,
f
More information about the Python-list
mailing list