How about:

len(a) - a[-1::-1].index("hello") - 1

Edit (put in function as suggested):

def listRightIndex(alist, value):
    return len(alist) - alist[-1::-1].index(value) -1
Answer from EwyynTomato on Stack Overflow
๐ŸŒ
W3Schools
w3schools.com โ€บ python โ€บ ref_string_rindex.asp
Python String rindex() Method
Remove List Duplicates Reverse ... Plan Python Interview Q&A Python Training ... The rindex() method finds the last occurrence of the specified value....
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ python-last-occurrence-of-some-element-in-a-list
Last Occurrence of Some Element in a List - Python - GeeksforGeeks
July 11, 2025 - For example, w = ["apple", "banana", "orange", "apple", "grape"] we need to find last occurrence of string 'apple' so output will be 3 in this case. rindex() method in Python returns the index of the last occurrence of an element in a list.
๐ŸŒ
Python
bugs.python.org โ€บ issue36639
Issue 36639: Provide list.rindex() - Python tracker
April 16, 2019 - This issue tracker has been migrated to GitHub, and is currently read-only. For more information, see the GitHub FAQs in the Python's Developer Guide ยท This issue has been migrated to GitHub: https://github.com/python/cpython/issues/80820
๐ŸŒ
CSDN
devpress.csdn.net โ€บ python โ€บ 630464117e6682346619af34.html
Equivelant to rindex for lists in Python [duplicate]_python_Mangs-Python
August 23, 2022 - Answer a question Is there an efficient way to find the last matching item in a list? When working with strings, you can find the last item with rindex: >>> a="GEORGE" >>> a.rindex("G") 4 ...But this Mangs Python
๐ŸŒ
Programiz
programiz.com โ€บ python-programming โ€บ methods โ€บ string โ€บ rindex
Python String rindex()
quote = 'Do small things with great love' # Substring is searched in ' small things with great love' print(quote.rindex('t', 2)) # Substring is searched in 'll things with' print(quote.rindex('th', 6, 20)) # Substring is searched in 'hings with great lov' print(quote.rindex('o small ', 10, -1))
๐ŸŒ
GitHub
github.com โ€บ VoyagerX21 โ€บ listrindex
GitHub - VoyagerX21/listrindex: ๐Ÿ” A simple Python utility to get the last index of an element in a list โ€” like list.index(), but in reverse! ๐Ÿ’กโœจ
In Python, list.index(x) returns the first index of x in a list. The listrindex class provides the method rindex(list, object) that returns the last index where the object appears.
Author: VoyagerX21
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python-string-rindex-method
Python String rindex() Method - GeeksforGeeks
January 7, 2025 - Note: If start and end indexes are not provided then by default Python String rindex() Method takes 0 and length-1 as starting and ending indexes where ending indexes is not included in our search.
Find elsewhere
๐ŸŒ
Javatpoint
javatpoint.com โ€บ python-string-rindex-method
Python String | rindex() method with Examples - Javatpoint
Python String rindex() method with Examples on capitalize(), center(), count(), encode(), find(), format(), index(), join(), lower(), ljust(), isupper(), istitle(), isspace(), isprintable(), isnumeric(), islower() etc.
๐ŸŒ
Codecademy
codecademy.com โ€บ docs โ€บ python โ€บ strings โ€บ .rindex()
Python | Strings | .rindex() | Codecademy
October 6, 2023 - .rindex() is used to locate the highest index of the substring within a string variable.
๐ŸŒ
Learn By Example
learnbyexample.org โ€บ python-string-rindex-method
Python String rindex() Method - Learn By Example
April 20, 2020 - The rindex() method searches for the last occurrence of the specified substring sub and returns its index.
๐ŸŒ
W3Schools
w3schools.com โ€บ python โ€บ ref_list_index.asp
Python List index() Method
Python DSA Lists and Arrays Stacks Queues Linked Lists Hash Tables Trees Binary Trees Binary Search Trees AVL Trees Graphs Linear Search Binary Search Bubble Sort Selection Sort Insertion Sort Quick Sort Counting Sort Radix Sort Merge Sort
๐ŸŒ
Tutorial Gateway
tutorialgateway.org โ€บ python-rindex
Python rindex
April 1, 2025 - Python rindex method return the index position of the last occurrence of a specified string. If not found, Python rindex returns Value Error.
๐ŸŒ
Jobtensor
jobtensor.com โ€บ Tutorial โ€บ Python โ€บ en โ€บ String-Methods-rindex
Python String rindex(), Definition, Syntax, Parameters, Examples | jobtensor
Python is a scripting language." result = testStr.rindex("t", 10, 25) print(result) # comparison between rindex() and rfind() testStr = "Welcome to the Python tutorials." print(testStr.rfind("x")) print(testStr.rindex("x"))
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ string-rindex-python
String rindex() in python - GeeksforGeeks
January 9, 2018 - The rindex() method returns the highest index of the substring inside the string if substring is found.
๐ŸŒ
Toppr
toppr.com โ€บ guides โ€บ python-guide โ€บ references โ€บ methods-and-functions โ€บ methods โ€บ string โ€บ rindex โ€บ python-string-index
Python rindex() function | Why do we use Python String rindex() function? |
September 27, 2021 - There might arise a situation where the user might want to find out the position of a specific data element in the iterable. This operation can be performed by using the string handling methods provided by Python. For this issue, the Python rindex() method is used.
๐ŸŒ
Tutorialspoint
tutorialspoint.com โ€บ python โ€บ string_rindex.htm
Python String rindex() Method
Python string method rindex() searches for the last index where the given substring str is found in an original string. This method raises an exception if no such index exists, optionally restricting the search to string length, i.e. from the ...
๐ŸŒ
Rdrr.io
rdrr.io โ€บ cran โ€บ rindex โ€บ src โ€บ R โ€บ index.R
rindex source: R/index.R - rdrr.io
tab index EQual value \cr #! ... #! \code{\link{match.rindex}} \tab use this to match in an rindex instead of \code{\link[base]{match}} \cr #! } #! } #! \value{ #! An object of class \sQuote{index}, i.e. a list with components #! \item{val}{sorted vector of values} #! ...
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ python-pandas-series-str-rindex
Python | Pandas Series.str.rindex() - GeeksforGeeks
July 11, 2025 - Pandas str.rindex() method is used to search and return highest index(First from right side) of a substring in particular section (Between start and end) of every string in a series.