Home / Python Tips Generated By ChatGPT / Negative Indexing in Python Access elements from the end of a list. Source Code my_list = [1, 2, 3, 4, 5] print(my_list[-1]) # Last item print(my_list[-2]) # Second to last item