Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- text = input().split()
- d = dict() #skolko raz vstretili
- for word in text:
- if word not in d:
- d[word] = 1
- else:
- d[word] += 1
- max_c = -1
- for key in d:
- if d[key] > max_c:
- max_c = d[key]
- max_w = key
- elif d[key] == max_c:
- if key < max_w:
- max_w = key
- print(max_w)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement