human
Can you provide a code to sum of the alphabetical values of the characters of a string and the other steps required given the following:
Sum of the alphabetical values of the characters of a string | Function to find string score.
Driver code"
How can the above be solved in Python?
assistant
#Here is code to sum of the alphabetical values of the characters of a string and the other steps required.
 def strScore ( str , s , n ) :
	score = 0
	index = 0
	for i in range ( n ) :
		if ( str [ i ] == s ) :
			for j in range ( len ( s ) ) :
				score += ( ord ( s [ j ] ) - ord ( ' a ' ) + 1 )
			index = i + 1
			break
	score = score * index
	return score
str = [ " sahil " , " shashanak " , " sanjit " , " abhinav " , " mohit " ]
s = " abhinav "
n = len ( str )
score = strScore ( str , s , n ) ;
print ( score )