changeset 21:c05704d14958 default tip

py3
author Jeff Hammel <k0scist@gmail.com>
date Wed, 02 Feb 2022 16:15:36 +0000
parents baa70e3b3896
children
files wordstream/dissociate.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/wordstream/dissociate.py	Fri Aug 13 10:53:38 2021 -0700
+++ b/wordstream/dissociate.py	Wed Feb 02 16:15:36 2022 +0000
@@ -10,11 +10,11 @@
 
 def dissociate(corpus, output=sys.stdout):
     while corpus:
-        word = random.choice(corpus.keys())
+        word = random.choice(list(corpus.keys()))
         inedible = True
         while corpus.get(word):
             inedible = False
-            print>> output,  word,
+            print((output, word))
             word = corpus.eat(word)
         if inedible: # eat it anyway
             corpus.eat(word)