human
Count of substrings consisting only of vowels | Function to check if a character is vowel or not.
Function to check whether string contains only vowel.
Check if the character is not vowel then invalid.
Function to Count all substrings in a string which contains only vowels.
Generate all substring of s.
If temp contains only vowels.
Increment the count.
Driver code"
How can the above be solved in Python?

What is a code to count of substrings consisting only of vowels and the other steps required?
assistant
#Here is code to count of substrings consisting only of vowels and the other steps required.
 def isvowel ( ch ) :
	return ( ch == ' a ' or ch == ' e ' or ch == ' i ' or ch == ' o ' or ch == ' u ' )
def isvalid ( s ) :
	n = len ( s )
	for i in range ( n ) :
		if ( not isvowel ( s [ i ] ) ) :
			return False
	return True
def CountTotal ( s ) :
	ans = 0
	n = len ( s )
	for i in range ( n ) :
		temp = " "
		for j in range ( i , n ) :
			temp += s [ j ]
			if ( isvalid ( temp ) ) :
				ans += 1
	return ans
if __name__ == ' _ _ main _ _ ' :
	s = " aeoibsddaaeiouudb "
	print ( CountTotal ( s ) )