problem while going through a tutorial

Ralf Schönian ralf at schoenian-online.de
Mon Dec 11 23:11:07 EST 2006


Simon Schuster schrieb:
[..]
>>>> x = "fljshfjh"
>>>> x
> 'fljshfjh'
>>>> count(x, 'h')
> Traceback (most recent call last):
>  File "<stdin>", line 1, in ?
> NameError: name 'count' is not defined
> 
> I'm not sure what changed, because it used to work. anyhow thanks a lot!

You forgot to import the string module:
from string import *

Regards,
Ralf Schoenian



More information about the Python-list mailing list