projects
/
wordplay-cdsw-solutions
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Whitespace corrections, a couple bug fixes, replacing a format string with constructi...
[wordplay-cdsw-solutions]
/
solution_7.py
diff --git
a/solution_7.py
b/solution_7.py
index b7f8dde6d7858d1e58d4c0782f067d0c031d0f05..61cb133795aefc14d9764896503dba58b817bba3 100644
(file)
--- a/
solution_7.py
+++ b/
solution_7.py
@@
-1,8
+1,6
@@
import scrabble
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 = ''
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:
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
print max_score
print max_word
-
-
Benjamin Mako Hill
||
Want to submit a patch?