[Tutor] Hi

Kaushal Shriyan kaushalshriyan at gmail.com
Wed Mar 22 09:55:55 CET 2006


On 3/22/06, Alan Gauld <alan.gauld at freenet.co.uk> wrote:
> > I got this, Lets say if its mystring[n:m] where n may be another
> > number and m may be another number so how will it work in that case,
> > so this becomes general and makes more clear
> >
> n is the index of the first character and m is the index *beyond*
> the last character
>
> > Lets say if its mystring[3:8] so how will i evaluate it
>
> It will return the characters at indexes 3,4,5,6, and 7.
>
> In other words it operates in the same way as the range
> function.
>
> you could get the same set of characters back using
>
> for index in range(n,m):
>    print mystring[index]
>
> Does that help?
>
> Alan G
> Author of the learn to program web tutor
> http://www.freenetpages.co.uk/hp/alan.gauld
>
>
>
>
Thanks a Lot for all the help, Its excellent and too good

Appreciate all of you for making me clear and better in understanding.

Regards

Kaushal


More information about the Tutor mailing list