Tim Johnson wrote:
> Hi Guys,
Hi Tim!
> Very simple question, I imagine.
>
> this code throws of off a "counter not defined error".
Instead of retyping the error message it is better to cut and paste the
traceback, e. g.
Traceback (most recent call last):
File "tmp.py", line 6, in
pri
On 21/02/2015 16:48, Tim Johnson wrote:
I've changed the subject line to reflect your question. Did you have to
reply to the digest and include the lot of it, why couldn't you simply
start a new thread?
Hi Guys,
Very simple question, I imagine.
this code throws of off a "counter not define
On 21/02/15 16:48, Tim Johnson wrote:
Hi Guys,
Hi, please don't send the entire digest, some folks pay by the byte.
Ideally send a new mail to tutor@python.org instead of replying to an
existing digest.
Also change the subject to something meaningful so folks an find
it in the archives.
*d
On Feb 21, 2015 8:49 AM, "Tim Johnson" wrote:
>
> Hi Guys,
> Very simple question, I imagine.
>
> this code throws of off a "counter not defined error".
> Can you help?
>
> *def word_counter(word, string):*
> *counter = 0*
> *for item in string:*
> *if item == word:*
> *
Hi Guys,
Very simple question, I imagine.
this code throws of off a "counter not defined error".
Can you help?
*def word_counter(word, string):*
*counter = 0*
*for item in string:*
*if item == word:*
*counter = counter + 1*
*print counter*
Thanks,
Tim
--
Tim Johnso