human
Check if the string satisfies the given condition | Function that returns true if n is prime.
Corner cases.
This is checked so that we can skip middle five numbers in below loop.
Function that returns true if c is a vowel.
Function that returns true if the count of vowels in word is prime.
If count of vowels is prime.
Driver code"
Solution in Python:
 Write me a code to check if the string satisfies the given condition and the other steps required?
assistant
#Here is code to check if the string satisfies the given condition and the other steps required.
 def prime ( n ) :
	if ( n <= 1 ) :
		return False
	if ( n <= 3 ) :
		return True
	if ( n % 2 == 0 or n % 3 == 0 ) :
		return False
	i = 5
	while i * i <= n :
		if ( n % i == 0 or n % ( i + 2 ) == 0 ) :
			return False
		i += 6
	return True
def isVowel ( c ) :
	c = c . lower ( )
	if ( c == ' a ' or c == ' e ' or c == ' i ' or c == ' o ' or c == ' u ' ) :
		return True
	return False
def isValidString ( word ) :
	cnt = 0 ;
	for i in range ( len ( word ) ) :
		if ( isVowel ( word [ i ] ) ) :
			cnt += 1
	if ( prime ( cnt ) ) :
		return True
	else :
		return False
if __name__ == " _ _ main _ _ " :
	s = " geeksforgeeks "
	if ( isValidString ( s ) ) :
		print ( " YES " )
	else :
		print ( " NO " )