get last object of list code example
Example 1: python get last element in list
l = [1, 2, 3]
l[-1]
Example 2: access last element of list python
MyList=["Black","Blue","Red","Green"]
print(MyList[-1])
l = [1, 2, 3]
l[-1]
MyList=["Black","Blue","Red","Green"]
print(MyList[-1])