"vishwajeet singh" <dextrou...@gmail.com> wrote

Thanks for your response but I am still not clear; can you show me the
equivalent of [::-1]  in terms actually specifying start-index, end-index
which gives me reverse of the given arrary.

I don't think you can, you must use the empty value.

In theory you could use -1 except of course -1 refers to the 'e'...

Its a slight anomoly due to the use of negative indexing. You
can do:

'abcde'[0:5]

and get the same as [0:]

But you cannot put any valid value for x in

'abcde[4 : x :-1]

that gets you the full string. You need to use [4::-1]

HTH,


--
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to