You are viewing a single comment's thread. Return to all comments →
Python3
from collections import OrderedDict ordered_dict = OrderedDict() n = int(input()) for _ in range(n): myinput = input() try: if ordered_dict[myinput]: ordered_dict[myinput] += 1 except KeyError: ordered_dict[myinput] = 1 print(len(ordered_dict.items())) for x,y in ordered_dict.items(): print(y, end=" ")
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 →
Python3