We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 97bb002 commit 84d9cbeCopy full SHA for 84d9cbe
Dictionary/main10.py
@@ -0,0 +1,17 @@
1
+# python words.py
2
+# Enter file: words.txt
3
+# to 16
4
+
5
6
7
+name = input('Enter file: ')
8
+handle = open(name)
9
10
+counts = dict()
11
12
13
14
+for line in handle:
15
+ words = line.split()
16
+ for word in words:
17
+ counts[word] = counts.get(word, 0) + 1
Dictionary/main11.py
@@ -0,0 +1,13 @@
+# Enter file: clown.txt
+# the 17
+bigcount = None
+bigword = None
+for word,count in counts.items():
+ if bigcount is None or count > bigcount:
+ bigword = word
+ bigcount = count
+print(bigword, bigcount)
0 commit comments