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.
๐ŸŒ
Programiz
programiz.com โ€บ python-programming โ€บ methods โ€บ string โ€บ rindex
Python String rindex()
The rindex() method returns the highest index of the substring inside the string (if found). If the substring is not found, it raises an exception.
๐ŸŒ
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
๐ŸŒ
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"))
๐ŸŒ
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
Find elsewhere
๐ŸŒ
Javatpoint
javatpoint.com โ€บ python-string-rindex-method
Python String | rindex() method with Examples - Javatpoint
Python Array vs. List ... MATLAB vs. Python ... Python vs. Julia ... Python Mutable vs. Immutable Data Types ... NumPy. Logical_ or() in Python
๐ŸŒ
Tutorialspoint
tutorialspoint.com โ€บ python โ€บ string_rindex.htm
Python String rindex() Method
Tutorialspoint is an ian company' # finding the 'Tutorialspoint' using rindex print(string.rindex('Tutorialspoint')) # finding the 'is' using rfind print(string.rindex('is')) The output produced by the program above is given as follows โˆ’ ... If we pass three parameters (including optional) to the method, the last index of the substring within the given index limit is detected. In this example, the method is called on an input string and it takes three parameters: a substring to be located, start index and the end index. # inputting a string string = 'Tutorialspoint is a great place to learn Python.
๐ŸŒ
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
๐ŸŒ
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.
๐ŸŒ
Tutorial Gateway
tutorialgateway.org โ€บ python-rindex
Python rindex
April 1, 2025 - The rindex function allows us to use Starting and ending indices. By specifying the starting and ending index positions, we can increase performance. The following statement starts looking for โ€˜abcโ€™ from 2 and ends at position 21.
๐ŸŒ
Learn By Example
learnbyexample.org โ€บ python-string-rindex-method
Python String rindex() Method - Learn By Example
April 20, 2020 - # Find the index of last occurrence of the substring 'Big' S = 'Big, Bigger, Biggest' x = S.rindex('Big') print(x) # Prints 13
๐ŸŒ
Python Reference
python-reference.readthedocs.io โ€บ en โ€บ latest โ€บ docs โ€บ str โ€บ rinddex.html
rindex โ€” Python Reference (The Right Way) 0.1 documentation
Returns the index of the first occurrence of the string searched for (raises ValueError if not found). ... Required. The string searched for. ... Optional. Search start position. ... Optional. Search end position. ... >>> "ABAB".rindex("B") 3 >>> "ABAB".rindex("B", 2, 4) 3 >>> "ABAB".rindex("B", ...
๐ŸŒ
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 - Python rindex() built-in function is used to return the highest index value of the last occurrence of the substring from the input string, if the substring is found. If the substring specified is not found, then it raises an exception.
๐ŸŒ
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.
๐ŸŒ
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.