Sobes.tech
Middle

a = [1, 2, 3] print(a[-1])

sobes.tech AI

Answer from AI

In Python, index -1 in lists refers to the last element. In this example, a[-1] will return the last element of list a, which is the number 3.

a = [1, 2, 3]
print(a[-1])  # Outputs: 3