Differences between revisions 1 and 4 (spanning 3 versions)
Revision 1 as of 2008-04-12 17:21:21
Size: 305
Editor: anonymous
Comment:
Revision 4 as of 2008-04-14 13:48:51
Size: 368
Editor: PaulLamp
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
#acl AdminGroup:read,write #acl AdminGroup:read,write EditorGroup:read,write All:read
Line 3: Line 3:
{{{ SiaExercisesLesson1

{{{#!python

SiaExercisesLesson1

Toggle line numbers
   1 d,l,s={},[],[]
   2 l=file('test.txt').read().split() # Einlesen der Datei und Aufspalten der Worte in eine Liste
   3 for word in l:
   4         d[word]=l.count(word) 
   5 for word, count in d.items():
   6     s.append([count, word])
   7 s.sort()
   8 for count, word in s:
   9         print word,     count

LehreWiki: SiaExercisesLesson1LoesungListenStrings (last edited 2008-04-14 13:48:51 by PaulLamp)