invert or reverse a string... warning this is a rant

Fredrik Lundh fredrik at pythonware.com
Thu Oct 19 15:17:38 EDT 2006


rick wrote:

>> Well, there you go!  Apparently, your wet paper bag has no "detect a 
>> palendrome" exit.  While you're installing such an egress to your soggy 
>> dead-tree satchel, you could also provide similar "write a binary 
> 
> Glad you guys are enjoying this. We're getting off-topic and I think my 
> point is being lost to jest.
> 
> As humans, we know very little. But one of the basics of our knowledge 
> is order or sequence. 1,2,3,4 is natural so is 4,3,2,1 (count down to 
> blast off for example). When we put our shirt on inside-out or watch 
> someone moon walk (Micheal Jackson) it's immediately obvious and easy to 
> see that the sequence is reversed. Backwards is pure, simple and easy. 
> This is not so in Python and it should be.

     natural = 1, 2, 3, 4
     for item in reversed(natural):
         print item
     print "badabom!"

 > That's all I have to day about that.

thank you.

</F>




More information about the Python-list mailing list