finding last element in list prolog code example
Example 1: access last element of list python
MyList=["Black","Blue","Red","Green"]
print(MyList[-1])
Example 2: how to access the last element of a list in python
l = [1, 2, 3, 4, 5]
print(l[-1])