If for some reason you don't want to use `str.rfind` and are only trying to find 1 character, you can look for all indices that fit your criteria and take the maximum like so
word = "banana"
a = "a"
last_index = max(i for (i, c) in enumerate(word) if c == a)
print(last_index)