Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- user = input()
- words01 = user.split(" ")
- words02 = set(words01)
- temp_result = []
- for word in words02:
- temp_result.append([word, words01.count(word)])
- popular_words = sorted(temp_result, key = lambda x : x[1], reverse=True)
- result = []
- count = popular_words[0][1]
- for word in popular_words:
- if count == word[1]:
- result.append(word[0])
- result_sort = sorted(result)
- print(result_sort[0])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement