On May 17, 2005, at 22:00, Smith, Jeff wrote: > Is there a more Pythonic way to get the Perl equivalent of > $#var > other than > len(var) - 1
AFAIK, len(var) - 1 is the only way. Note, however, that the last element of a list (or of any ordered sequence) can be obtained with the shortcut var[-1]. -- Max maxnoel_fr at yahoo dot fr -- ICQ #85274019 "Look at you hacker... A pathetic creature of meat and bone, panting and sweating as you run through my corridors... How can you challenge a perfect, immortal machine?" _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor