Python limericks (was Re: Text-to-speech)

smitty_one_each smitty_one_each at hotmail.com
Thu Mar 24 12:13:16 EST 2005


Michael Spencer wrote:
> How about a category for executable limericks?
>
> Here's one to get the ball rolling:
>
>
> # voice only the alphanumeric tokens
>
> from itertools import repeat
> for feet in [3,3,2,2,3]:
>      print " ".join("DA-DA-DUM"
>      for dummy in [None]
> for foot in repeat("metric", feet))
>
>
>
> Michael
>
>
> P.S. I know 'three' doesn't rhyme.

Well, don't be so harsh on yourself.
You get a weak correlation between the 'ee' in 3 and the ('eat','eet')
tuple, based on assonance.  
Good work.




More information about the Python-list mailing list