Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python last index of item in list

def list_rindex(li, x):
    for i in reversed(range(len(li))):
        if li[i] == x:
            return i
    raise ValueError("{} is not in list".format(x))
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #index #item #list
ADD COMMENT
Topic
Name
4+8 =