Source Code:
(back to article)
my_list = [1, 2, 3, 4, 5] # Get the last element last_element = my_list[-1] print(last_element) # Output: 5
Result:
Report an issue