projects
/
wordplay-cdsw-solutions
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
reworked these examples a bit based on feedback in class
[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
8
for word in scrabble.wordlist:
9
score = 0
10
for char in word:
11
score = score + scrabble.scores[char]
12
if score > max_score:
13
max_word = word
14
max_score = score
15
16
print(str(max_score) + " : " + max_word)
Benjamin Mako Hill
||
Want to submit a patch?