human
Find last index of a character in a string | Returns last index of x if it is present . Else returns - 1..
Traverse from right.
Driver code"
How can the above be solved in Python?

=====
Write me a code to find last index of a character in a string and the other steps required?
assistant
#Here is code to find last index of a character in a string and the other steps required.
 def findLastIndex ( str , x ) :
	for i in range ( len ( str ) - 1 , - 1 , - 1 ) :
		if ( str [ i ] == x ) :
			return i
	return - 1
str = " geeksforgeeks "
x = ' e '
index = findLastIndex ( str , x )
if ( index == - 1 ) :
	print ( " Character ▁ not ▁ found " )
else :
	print ( " Last ▁ index ▁ is ▁ " , index )