Skip to content

Commit

Permalink
Update Count Numbers in list for histogram. py.py
Browse files Browse the repository at this point in the history
  • Loading branch information
codeperfectplus committed Jan 28, 2020
1 parent 5514bd9 commit f274404
Showing 1 changed file with 2 additions and 70 deletions.
72 changes: 2 additions & 70 deletions Python Intermediate/Count Numbers in list for histogram. py.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,76 +3,8 @@
it to create Histogram
'''
from collections import Counter
document = (10,
1,
10,
5,
7,
4,
1,
1,
10,
10,
9,
10,
1,
3,
9,
9,
4,
1,
8,
6,
7,
3,
6,
7,
3,
10,
5,
3,
10,
4,
6,
8,
10,
5,
5,
9,
10,
8,
10,
9,
10,
10,
8,
7,
7,
10,
8,
6,
4,
6,
1,
9,
10,
2,
3,
3,
9,
2,
3,
8,
1,
7,
3,
10,
6,
6,
9,
6,
7,
9)
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,
6,4,6,1,9,10,2,3,9,2,3,8,1,7,3,10,6,6,9,6,7,9)
word_counts = Counter(document)
for word, count in word_counts.most_common(10):
print('The Number %d Comes %d times ' %(word,count))

0 comments on commit f274404

Please sign in to comment.