X-Git-Url: https://projects.mako.cc/source/wordplay-cdsw-solutions/blobdiff_plain/884ad8e21ea1ea9d1dd411b2a503d0dff4294c59..715cf79efb1139d981e5716ed14f471fbeaddb2a:/solution_7.py diff --git a/solution_7.py b/solution_7.py index b7f8dde..61cb133 100644 --- a/solution_7.py +++ b/solution_7.py @@ -1,8 +1,6 @@ import scrabble - -# Find the most valuable word in the dictionary using a double-loop. - +# Find the most valuable word in the dictionary using a double-loop. max_score = 0 max_word = '' @@ -11,10 +9,8 @@ for word in scrabble.wordlist: for char in word: score = score + scrabble.scores[char] if score > max_score: - max_word = word - max_score = score + max_word = word + max_score = score print max_score print max_word - -