Showing posts with label last element. Show all posts
Showing posts with label last element. Show all posts

Tuesday, 25 November 2008

Last element standing

To access the last element in a list, there's no need for the long-winded list[len(list) - 1].

All that's needed is list[-1].