human
Find last index of a character in a string | Returns last index of x if it is present . Else returns - 1..
String in which char is to be found.
char whose index is to be found"
Solution 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 ) :
	index = - 1
	for i in range ( 0 , len ( str ) ) :
		if str [ i ] == x :
			index = i
	return index
str = " geeksforgeeks "
x = ' e '
index = findLastIndex ( str , x )
if index == - 1 :
	print ( " Character ▁ not ▁ found " )
else :
	print ( ' Last ▁ index ▁ is ' , index )