Hi guys,

Continuing my Python learning, I came across an exercise which asks me
to take a string and reverse it.

I understand that there is a function to do this i.e mytext.reverse()

I imagine that the exercise author would rather I did this the hard
way however. ;-)

Assuming that mytext is "test", I've found that mytext[-1:-4:-1]
doesn't work (as I expected it to) but that mytext[::-1] does.

While that's fine, I just wondered why mytext[-1:-4:-1] doesn't work?

Thanks again,

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

Reply via email to