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 ... Python Study Plan Python Interview Q&A Python Training ... The rindex() method finds the last occurrence ......
๐ŸŒ
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()
If substring exists inside the string, it returns the highest index in the string where the substring is found.
๐ŸŒ
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
๐ŸŒ
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
๐ŸŒ
Jobtensor
jobtensor.com โ€บ Tutorial โ€บ Python โ€บ en โ€บ String-Methods-rindex
Python String rindex(), Definition, Syntax, Parameters, Examples | jobtensor
The rindex() method finds the last occurrence of the specified value. It raises an exception if the value is not found. This method is almost the same as the rfind() method. ... testStr = "Welcome to the Python tutorials. Python is a scripting language." result = testStr.rindex("Python") ...
Find elsewhere
๐ŸŒ
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
๐ŸŒ
Learn By Example
learnbyexample.org โ€บ python-string-rindex-method
Python String rindex() Method - Learn By Example
April 20, 2020 - The rindex() method is identical to the rfind() method. The only difference is that the rfind() method returns -1 (instead of raising a ValueError), if the substring is not found.
๐ŸŒ
Tutorial Gateway
tutorialgateway.org โ€บ python-rindex
Python rindex
April 1, 2025 - The Python rindex method is used to return the index position of the last occurrence of a specified string.
๐ŸŒ
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 - The syntax for the Python rindex() string function is as follows: ... Note โ€“ This method is case sensitive, for example, it will consider python and Python as 2 different words. ... Note โ€“ If the start and end parameters are not specified, the default values of start = 0 and end = length-1 (end of the string) are considered. The start index and end index parameters are useful if you want to limit your search for the substring to a specific part of the string.
๐ŸŒ
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.
๐ŸŒ
Webdevdata
webdevdata.net โ€บ python โ€บ functions โ€บ rindex
rindex Function | Python Documentation - Webdevdata
Partners with split and rpartition for text parsing. Used when substring must exist and searching from right is needed. Essential for validation and strict text processing from string's end. Read More about rindex from Python Documentation ... Returns the highest index where the substring is found.
๐ŸŒ
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.