changeset 145:4096771c8b9f

protect from no anagrams case
author Jeff Hammel <jhammel@mozilla.com>
date Wed, 15 Jun 2011 15:14:29 -0700
parents c9577c9af631
children e5c0188c5001
files python/anagram.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/python/anagram.py	Tue Jun 07 17:11:46 2011 -0700
+++ b/python/anagram.py	Wed Jun 15 15:14:29 2011 -0700
@@ -97,5 +97,6 @@
                  if i and is_in(i, anagram) is not None ]
     
     anagrams = anagramize(anagram, wordlist)
-    
-    print '\n'.join(anagrams)
+
+    if anagrams:
+        print '\n'.join(anagrams)