Contact: aviboots(AT)netvision.net.il
41,636 questions
54,299 answers
573 users
lst = ['python', 'c', 'c++', 'python', 'java', 'python', 'c', 'c#'] element = 'python' lst.reverse() index = lst.index(element) print('index = ' , len(lst) - index - 1) ''' run: index = 5 '''
lst = ['python', 'c', 'c++', 'python', 'java', 'python', 'c', 'c#'] element = 'python' index = len(lst) - 1 - lst[::-1].index(element) print('index = ' , index) ''' run: index = 5 '''