print last list code example Example: how to access the last element of a list in python l = [1, 2, 3, 4, 5] print(l[-1])