On 20/06/12 16:20, Martin A. Brown wrote:

  : should have written something like "counting how many times each
  : word occured" insted of "counting words".

You might like to try out collections.defaultdict().

Even a standard dict would simplify the code dramatically.
The defaultdict does suit this case better though.

--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/



_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to