--> snip

>However, even with countWords2, which is supposed to overcome this
>problem, it feels as if I've entered an infinite loop.

>Josep M.


Just my twopenneth, I'm a noob and I'm not going to try such a big file on
my old machine, but:

1. Maybe create a *set* from the wordlist, loop through that, so you call
"count" on wordlist only once.  OR

2. Use collections.defaultdict(int) and loop through wordlist and do
dic[word] += 1

Maybe, possibly.

Regards
Colin
-- 
if not ErrorMessage:
    check_all()
>>>check_all.__doc__
" noErrorMessage != correctAnswer"
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to