def last_n(items, n): # Return the last n items of the list. if n <= 0: return [] return items[-n:]