A suggestion for a possible Python module

phil hunt philh at cabalamat.org
Sat Mar 8 21:09:43 EST 2003


On Sat, 08 Mar 2003 18:26:25 GMT, Mark VandeWettering <wettering at attbi.com> wrote:
>In article
><mXQ8a.138632$UXa.63716 at news02.bloor.is.net.cable.rogers.com>, Lance
>LaDamage wrote:
>
>> I have noticed that there is one thing that everyone wishes to do in Python
>> ... reverse a string. 
>
>Really?  Whatever for?
>
>Honestly, what commonly programmed task requires string reversal? 

Homework assignments? Particularly ones to demonstrate recursion? 
E.g.:

def rev(s):
   if s=="": return s
   return s[-1:] + rev(s[:-1])

> I can't
>ever remember doing it even once during 20+ years of programming.

Me neither.

-- 
|*|*|  Philip Hunt <philh at cabalamat.org>  |*|*|
|*|*|  "Memes are a hoax; pass it on"     |*|*|





More information about the Python-list mailing list