Antoon Pardon <[EMAIL PROTECTED]> writes: > I sometimes think python should have been more explicite here, > using a marker for the start-index and end-index, may '^' and > '$'. So if you wanted the last element you had to write: > > lst[$] > > And for the next to last element: > > lst[$ - 1]
I like this. I don't know how many times I've gotten screwed by wanting the n'th element from the last for variable n, and saying "lst[n]" then realizing I have a bug when n=0. lst[$-n] works perfectly. -- http://mail.python.org/mailman/listinfo/python-list