On Tue, Jan 12, 2010 at 1:16 AM, Alan Gauld <alan.ga...@btinternet.com>wrote:
> > "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, > > Thanks Alan and Micheal that surely cleard my doubts. -- Vishwajeet Singh +91-9657702154 | dextrou...@gmail.com | http://singhvishwajeet.com Twitter: http://twitter.com/vishwajeets | LinkedIn: http://www.linkedin.com/in/singhvishwajeet
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor