Skip to content

Commit f274404

Browse files
Update Count Numbers in list for histogram. py.py
1 parent 5514bd9 commit f274404

File tree

1 file changed

+2
-70
lines changed

1 file changed

+2
-70
lines changed

Python Intermediate/Count Numbers in list for histogram. py.py

Lines changed: 2 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -3,76 +3,8 @@
33
it to create Histogram
44
'''
55
from collections import Counter
6-
document = (10,
7-
1,
8-
10,
9-
5,
10-
7,
11-
4,
12-
1,
13-
1,
14-
10,
15-
10,
16-
9,
17-
10,
18-
1,
19-
3,
20-
9,
21-
9,
22-
4,
23-
1,
24-
8,
25-
6,
26-
7,
27-
3,
28-
6,
29-
7,
30-
3,
31-
10,
32-
5,
33-
3,
34-
10,
35-
4,
36-
6,
37-
8,
38-
10,
39-
5,
40-
5,
41-
9,
42-
10,
43-
8,
44-
10,
45-
9,
46-
10,
47-
10,
48-
8,
49-
7,
50-
7,
51-
10,
52-
8,
53-
6,
54-
4,
55-
6,
56-
1,
57-
9,
58-
10,
59-
2,
60-
3,
61-
3,
62-
9,
63-
2,
64-
3,
65-
8,
66-
1,
67-
7,
68-
3,
69-
10,
70-
6,
71-
6,
72-
9,
73-
6,
74-
7,
75-
9)
6+
document = (10,1,10,5,7,4,1,1,10,10,9,10,1,3,9,9,4,8,6,7,3,6,7,3,10,5,3,10,4,6,8,10,5,5,10,10,9,10,10,8,7,7,10,8,
7+
6,4,6,1,9,10,2,3,9,2,3,8,1,7,3,10,6,6,9,6,7,9)
768
word_counts = Counter(document)
779
for word, count in word_counts.most_common(10):
7810
print('The Number %d Comes %d times ' %(word,count))

0 commit comments

Comments
 (0)