X-Git-Url: https://projects.mako.cc/source/wordplay-cdsw-solutions/blobdiff_plain/4e09563052459f99272cfee99d44f8a9abce85cb..715cf79efb1139d981e5716ed14f471fbeaddb2a:/solution_2.py diff --git a/solution_2.py b/solution_2.py index 9d5469d..335c79a 100644 --- a/solution_2.py +++ b/solution_2.py @@ -1,6 +1,5 @@ import scrabble - # What is the longest word that starts with a q? # This is the most common student solution, which prints the *first* occurence of # the longest word. See solution_2_advanced.py for more info. @@ -10,12 +9,8 @@ longest_so_far = '' # Store the longest word we've seen up to this point. for word in scrabble.wordlist: if word[0] == 'q': - if len(word) > len(longest_so_far): # What if I use >= rather than > here? - longest_so_far = word - #print word # Use this to see the progression. - + if len(word) > len(longest_so_far): # What if I use >= rather than > here? + longest_so_far = word + #print word # Use this to see the progression. print longest_so_far - - -