Merge pull request #1 from ben-zen/master
[wordplay-cdsw-solutions] / solution_5_easy.py
1 import scrabble
2
3 # Print every other word that starts with 'a' and is more than 9 letters long.
4 # This is the most basic implementation: keep a boolean to track whether the word
5 # was printed.
6
7 should_i_print = True
8
9 for word in scrabble.wordlist:
10     if word[0] == 'a' and len(word) >= 9:
11         if should_i_print:
12             print word
13             should_i_print = False
14         else:
15             should_i_print = True

Benjamin Mako Hill || Want to submit a patch?