You are viewing a single comment's thread. Return to all comments →
no modules required
n=int(input()) d={} for i in range(n): w=input() if w in d.keys(): d[w]+=1 else: d[w]=1 print(len(d)) for i in d.keys(): print(d[i],end=' ') print()
Seems like cookies are disabled on this browser, please enable them to open this website
Word Order
You are viewing a single comment's thread. Return to all comments →
no modules required
n=int(input()) d={} for i in range(n): w=input() if w in d.keys(): d[w]+=1 else: d[w]=1 print(len(d)) for i in d.keys(): print(d[i],end=' ') print()