Created
April 9, 2021 01:18
-
-
Save tjdevries/d6c899d0e2052d6820904da0b8464fb7 to your computer and use it in GitHub Desktop.
Yup, get ready begin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scores = { | |
"!hate": -2, | |
"!dislike": -1, | |
"!like": 1, | |
"!love": 2, | |
} | |
from collections import defaultdict | |
counts = defaultdict(int) | |
with open("input.txt") as f: | |
for l in f: | |
s = l.strip().split(" ") | |
counts[s[1]] += scores[s[0]] | |
from collections import Counter | |
print(Counter(counts).most_common(1)[0][0]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment