human
Program to count vowels in a string ( Iterative and Recursive ) | Function to check the Vowel.
Returns count of vowels in str.
Check for vowel.
string object.
Total number of Vowels"
How can the above be solved in Python?
 ... Give me a code to program to count vowels in a string ( Iterative and Recursive ) and the other steps required?
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 countVowels ( str ) :
	count = 0
	for i in range ( len ( str ) ) :
		if isVowel ( str [ i ] ) :
			count += 1
	return count
str = ' abc ▁ de '
print ( countVowels ( str ) )