Mercurial > hg > config
comparison python/anagram.py @ 145:4096771c8b9f
protect from no anagrams case
| author | Jeff Hammel <jhammel@mozilla.com> |
|---|---|
| date | Wed, 15 Jun 2011 15:14:29 -0700 |
| parents | 099a3bfa2852 |
| children | 83618049c2ff |
comparison
equal
deleted
inserted
replaced
| 144:c9577c9af631 | 145:4096771c8b9f |
|---|---|
| 95 | 95 |
| 96 wordlist = [ i for i in dictionary | 96 wordlist = [ i for i in dictionary |
| 97 if i and is_in(i, anagram) is not None ] | 97 if i and is_in(i, anagram) is not None ] |
| 98 | 98 |
| 99 anagrams = anagramize(anagram, wordlist) | 99 anagrams = anagramize(anagram, wordlist) |
| 100 | 100 |
| 101 print '\n'.join(anagrams) | 101 if anagrams: |
| 102 print '\n'.join(anagrams) |
