Re: [Tutor] string reversal using [::-1]

2017-06-12 Thread Vikas YADAV
.pyt...@gmail.com] Sent: Monday, June 12, 2017 1:26 AM To: Vikas YADAV Cc: tutor Subject: Re: [Tutor] string reversal using [::-1] [QUOTED ENTIRELY FROM STEVE {st...@pearwood.info} IN ANSWER TO A SLICING QUESTION] The way to think about string indexing and slicing is that the index positions

[Tutor] string reversal using [::-1]

2017-06-10 Thread Vikas YADAV
Question: Why does "123"[::-1] result in "321"? MY thinking is [::-1] is same as [0:3:-1], that the empty places defaults to start and end index of the string object. So, if we start from 0 index and decrement index by 1 till we reach 3, how many index we should get? I think we should get infi