3 # Print the longest word where every character is unique.
4 # I use a double loop in this. Note that I also re-use my "longest word" logic
5 # from the easy solution to (2).
7 # See the advanced solution for a shorter way to do this.
10 for word in scrabble.wordlist:
13 for character in word:
14 # have we seen this character before?
15 if character in local_chars:
17 break # Exit the loop early, since we've found a collision.
19 local_chars[character] = 1
22 new_words.append(word)
24 # Reuse my code for longest word
26 for word in new_words:
27 if len(word) > len(longest_so_far):