[Tutor] reversing a string

Chad Crabtree flaxeater at yahoo.com
Sat Oct 9 21:19:50 CEST 2004


Lloyd Kvam wrote:

>> >>> 'qwerty'[-1::-1]
>>'ytrewq'
>>
>>Rich
>>    
>>
>
> This works in 2.3:
>
>  
>
>
>Or the slightly simpler to type:
>
>  
>
>>>>'gfedcba'[::-1]
>>>>        
>>>>
>'abcdefg'
>  
>

Could Someone please explain what just happened there?  I know it's 
slicing, I just don't understand how.

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


More information about the Tutor mailing list