projects
/
wordplay-cdsw-solutions
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Update README.md
[wordplay-cdsw-solutions]
/
solution_5_easy.py
1
import scrabble
2
3
4
# Print every other word that starts with 'a' and ends with 9
5
# This is the most basic implementation: keep a boolean to track whether the word
6
# was printed.
7
8
should_i_print = True
9
10
for word in scrabble.wordlist:
11
if word[0] == 'a' and len(word) >= 9:
12
if should_i_print:
13
print word
14
should_i_print = False
15
else:
16
should_i_print = True
17
Benjamin Mako Hill
||
Want to submit a patch?