Python Program to Get the Last Element of the List

 

Using negative indexing


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

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


0 Comments