Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sentence = input().split()
- d = dict()
- max_count = 0
- for word in sentence:
- if word in d:
- d[word] += 1
- else:
- d[word] = 1
- for word in d:
- if d[word] > max_count:
- max_count = d[word]
- max_word = word
- elif d[word] == max_count:
- max_word = min(word, max_word)
- print(max_word)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement