Re: What's the difference between these 2 statements?

2005-04-20 Thread ahmedt
s[len(s):-1:-1] yields an empty list !

Test code :

s = "12345"
print s[len(s)::-1] -> prints "54321"
print s[len(s):-1:-1]  -> prints "" (nothing)

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: What's the difference between these 2 statements?

2005-04-20 Thread ahmedt
I'm sorry, I'm not really following your logic. Can you supply the
statement with the three parameters ?

so if I want to reverse it fully using s[len(s)-1:x:-1] what would x be
or is it impossible to express it in this way ?

Thanks,
AT

-- 
http://mail.python.org/mailman/listinfo/python-list