How to get the index of a substring contained in a python str looking from the end of string?