Simon Forman wrote:

> strings have a count() method.

thanks!

For enrichment purposes, is there a way to do this sort of thing with
a generator?  E.g. something like:

def SentenceGenerator():
   words = ['I', 'have', 'been', 'to', 'the', 'fair']
   for w in words: 
      yield w

message = "%s %s %s %s"

print message % SentenceGenerator()

(I ask because the above doesn't work)?
-tom!
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to