projects
/
wordplay-cdsw-solutions
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
reworked these examples a bit based on feedback in class
[wordplay-cdsw-solutions]
/
solution_8_broken.py
diff --git
a/solution_8_broken.py
b/solution_8_broken.py
index 554fcd9798c21f47750f3bd66a7ab075646e406b..ca69baef4a9651dc11568a9b2ceda879a0862f27 100644
(file)
--- a/
solution_8_broken.py
+++ b/
solution_8_broken.py
@@
-4,6
+4,7
@@
import scrabble
max_score = 0
max_word = ''
max_score = 0
max_word = ''
+
for word in scrabble.wordlist:
if word[0] == 'a' and word[3] == 'e' and len(word) <= 7 and len(word) >= 4:
score = 0
for word in scrabble.wordlist:
if word[0] == 'a' and word[3] == 'e' and len(word) <= 7 and len(word) >= 4:
score = 0
@@
-13,5
+14,5
@@
for word in scrabble.wordlist:
max_word = word
max_score = score
max_word = word
max_score = score
-print
max_score
-print max_word
+print
(str(max_score) + " : " + max_word)
+
Benjamin Mako Hill
||
Want to submit a patch?