4 # Print hte longest word where every digit is unique.
5 # I use a double loop in this. Note that I also re-use my "longest word" logic
6 # from the easy solution to (2).
8 # See the advanced solution for a shorter way to do this.
12 for word in scrabble.wordlist:
15 for character in word:
16 # have we seen this character before?
17 if character in local_chars:
21 local_chars[character] = 1
24 new_words.append(word)
26 # Reuse my code for longest
28 for word in new_words:
29 if len(word) > len(longest_so_far):