Answers for "Find the position of the last occurrence of word in someList"

0

Find the position of the last occurrence of word in someList

s = "hello"
target = "l"
last_pos = len(s) - 1 - s[::-1].index(target)
Posted by: Guest on April-03-2022

Code answers related to "Find the position of the last occurrence of word in someList"

Browse Popular Code Answers by Language