get the last item in an array of object python code example
Example 1: access last element of list python
MyList=["Black","Blue","Red","Green"]
print(MyList[-1])
Example 2: check if is the last element in list python
if x == my_list[-1]:
# do what you want