Skip to content

Commit

Permalink
Added Counting occurrence of each word (Python) in proper folder
Browse files Browse the repository at this point in the history
  • Loading branch information
nazuk27 authored Oct 26, 2020
1 parent a4c49e2 commit 097a868
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

# Program to find the number of occurrence of each unique word in the sequence of occurrence of each word.

from collections import Counter

if __name__ == '__main__':
n = int(input())
w = []
for i in range(n):
x = input()
w.append(x)
c = Counter(w)
l = len(c)
print(l)
v = c.values()
for i in v:
print(i, end=' ')

0 comments on commit 097a868

Please sign in to comment.