Andrei Alexandrescu:
> Python:
> lst[0]
> lst[len(lst)-1]

I have not read the whole thread so someone else may have already answered, but 
that's not pythonic, the last item is represented as:

>>> lst = "abcde"
>>> lst[-1]
'e'
>>> lst[-2]
'd'

etc.

You can write those in D as:
lst[$-1]
lst[$-2]

Bye,
bearophile

Reply via email to