What's the difference between these 2 statements?

ATSkyWalker ahmedt at gmail.com
Wed Apr 20 14:52:18 EDT 2005


What's the difference between these 2 statements?

If you have a String s="12345"

s[len(s)::-1] = "54321"

But

s[len(s):0:-1] = "5432"

Why? What's the difference? What number then can I use as the end of
the slice if I were to supply all 3 parameters?


Thanks,
AT



More information about the Python-list mailing list