reworked these examples a bit based on feedback in class
[wordplay-cdsw-solutions] / solution_2_advanced.py
index e4f056d844100e90eda53826ce4c80fd488f5f56..88678383d5dce54032bb81458d625c00d54fad74 100644 (file)
@@ -2,10 +2,12 @@ import scrabble
 
 # What is the longest word that starts with a q?
 
-# This problem was ill-specified. What if there isn't a single longest word? What if
-# there is a tie? 
-# We designed this problem with that ambiguity in mind, because sometimes the thing
-# we want to measure may not exist, or may not exist in the way we anticipate.
+# This problem was somewhat ill-specified. What if there isn't a
+# single longest word? What if there is a tie?
+
+# We designed this problem with that ambiguity in mind, because
+# sometimes the thing we want to measure may not exist, or may not
+# exist in the way we anticipate.
 
 # This solution keeps EVERY word of the longest length.
 
@@ -13,7 +15,6 @@ longest_so_far = []
 length_of_longest_word = 0
 
 for word in scrabble.wordlist:
-
     if word[0] == 'q':
         if len(word) > length_of_longest_word:
             length_of_longest_word = len(word)
@@ -22,4 +23,4 @@ for word in scrabble.wordlist:
             longest_so_far.append(word)
             #print longest_so_far  # Use this to see the progression.
 
-print longest_so_far
+print(longest_so_far)

Benjamin Mako Hill || Want to submit a patch?