Python Program to Get the Last Element of the List

bookmark

my_list = ['a', 'b', 'c', 'd', 'e']

# print the last element
print(my_list[-1])

 

Output

e