This is an old revision of the document!


04. Word Map

First, take a couple (3-4) of paragraphs from here and put them inside a Python string (multiline).

  • Build a dict with each word from this text (lower cased as key), counting their frequency (as its value).
  • Use it to print out the most frequent 5 words in this text (together with their value!), e.g.:
[('the', 29), ('of', 18), ('and', 15), ('to', 10), ('a', 9)]
ii/labs/s2/01/tasks/04.1679163426.txt.gz ยท Last modified: 2023/03/18 20:17 by florin.stancu
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0