We know rindex Only strings have , Returns the subscript of the first match found from back to front . The list doesn't have rindex, If necessary, you need to implement it yourself . Here is an implementation method :
def list_rindex(list1, target):
return len(list1) - list1[-1::-1].index(target) -1