We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents ab34ff5 + c9e0e21 commit 532fa65Copy full SHA for 532fa65
levantado/0004/word.txt
@@ -0,0 +1,3 @@
1
+
2
+l am the big big boy in the world;
3
+The world is big big include the boy ;
levantado/0004/worder.py
@@ -0,0 +1,20 @@
+import re
+import os
+from pprint import pprint
4
5
+path = os.getcwd() + '/word.txt'
6
7
8
+def wordstat(path):
9
+ f = open(path, 'r+')
10
+ wordcount = {}
11
+ for t in re.sub('[^0-9a-zA-Z]+', " ", f.read()).split():
12
+ if t not in wordcount:
13
+ wordcount[t] = 1
14
+ else:
15
+ wordcount[t] += 1
16
+ pprint(wordcount)
17
18
19
+if __name__ == '__main__':
20
+ wordstat(path)
0 commit comments