Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from collections import Counter
- votes = []
- total_votes = 0
- while True:
- try: vote = input()
- except EOFError: break
- votes.append(vote)
- total_votes += 1
- votes_count = Counter(votes)
- winners = votes_count.most_common(2)
- print(winners[0][0])
- if winners[0][1] / total_votes <= 0.5:
- print(winners[1][0])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement