projects
/
wordplay-cdsw-solutions
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Whitespace corrections, a couple bug fixes, replacing a format string with constructi...
[wordplay-cdsw-solutions]
/
solution_7.py
1
import scrabble
2
3
# Find the most valuable word in the dictionary using a double-loop.
4
5
max_score = 0
6
max_word = ''
7
for word in scrabble.wordlist:
8
score = 0
9
for char in word:
10
score = score + scrabble.scores[char]
11
if score > max_score:
12
max_word = word
13
max_score = score
14
15
print max_score
16
print max_word
Benjamin Mako Hill
||
Want to submit a patch?