how to print last four elements in list code example
Example 1: access last element of list python
MyList=["Black","Blue","Red","Green"]
print(MyList[-1])
Example 2: get last element of a list python
a = [1, 2, 3, 4]
print(a[-1])
#prints: 4
print(a[-2])
#prints: 3