X-Git-Url: https://projects.mako.cc/source/wordplay-cdsw-solutions/blobdiff_plain/884ad8e21ea1ea9d1dd411b2a503d0dff4294c59..HEAD:/solution_7.py diff --git a/solution_7.py b/solution_7.py index b7f8dde..7b89fa3 100644 --- a/solution_7.py +++ b/solution_7.py @@ -1,20 +1,16 @@ 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 = '' + for word in scrabble.wordlist: score = 0 for char in word: score = score + scrabble.scores[char] if score > max_score: - max_word = word - max_score = score - -print max_score -print max_word - + max_word = word + max_score = score +print(str(max_score) + " : " + max_word)