reworked these examples a bit based on feedback in class
[wordplay-cdsw-solutions] / solution_5_easy.py
index d34efdc085a6b5e12b02df5920f4b821d250808b..9dda191d5317c366be304fce82f71b344dc59c39 100644 (file)
@@ -1,7 +1,6 @@
 import scrabble
 
 import scrabble
 
-
-# Print every other word that starts with 'a' and ends with 9
+# Print every other word that starts with 'a' and is more than 9 letters long.
 # This is the most basic implementation: keep a boolean to track whether the word
 # was printed.
 
 # This is the most basic implementation: keep a boolean to track whether the word
 # was printed.
 
@@ -10,8 +9,7 @@ should_i_print = True
 for word in scrabble.wordlist:
     if word[0] == 'a' and len(word) >= 9:
         if should_i_print:
 for word in scrabble.wordlist:
     if word[0] == 'a' and len(word) >= 9:
         if should_i_print:
-            print word
+            print(word)
             should_i_print = False
         else:
             should_i_print = True
             should_i_print = False
         else:
             should_i_print = True
-            

Benjamin Mako Hill || Want to submit a patch?