GEICO Interview Question

Select the last element of a list in Python.

Interview Answer

Anonymous

Sep 7, 2022

Let’s assume we have a list with the following values L = [1,2,3,4,5] To select the last element just write the following L[-1]

1