human
Can you provide a code to program to count vowels in a string ( Iterative and Recursive ) and the other steps required given the following:
Program to count vowels in a string ( Iterative and Recursive ) | Function to check the Vowel.
to count total number of vowel from 0 to n.
string object.
Total numbers of Vowel"
Solution in Python:
assistant
#Here is code to program to count vowels in a string ( Iterative and Recursive ) and the other steps required.
 def isVowel ( ch ) :
	return ch . upper ( ) in [ ' A ' , ' E ' , ' I ' , ' O ' , ' U ' ]
def countVovels ( str , n ) :
	if ( n == 1 ) :
		return isVowel ( str [ n - 1 ] ) ;
	return ( countVovels ( str , n - 1 ) + isVowel ( str [ n - 1 ] ) ) ;
str = " abc ▁ de " ;
print ( countVovels ( str , len ( str ) ) )