human
Number of even substrings in a string of digits | Return the even number substrings ..
If current digit is even , add count of substrings ending with it . The count is ( i + 1 ).
Driven Program"
How can the above be solved in Python?
 ... What is a code to number of even substrings in a string of digits and the other steps required?
assistant
#Here is code to number of even substrings in a string of digits and the other steps required.
 def evenNumSubstring ( str ) :
	length = len ( str )
	count = 0
	for i in range ( 0 , length , 1 ) :
		temp = ord ( str [ i ] ) - ord ( '0' )
		if ( temp % 2 == 0 ) :
			count += ( i + 1 )
	return count
if __name__ == ' _ _ main _ _ ' :
	str = [ '1' , '2' , '3' , '4' ]
	print ( evenNumSubstring ( str ) )