Remove consecutive vowels from string | function which returns True or False for occurrence of a vowel ; this compares vowel with character 'c ; function to print resultant string ; print 1 st character ; loop to check for each character ; comparison of consecutive characters ; Driver code
def is_vow ( c ) : NEW_LINE ' NEW_LINE INDENT return ( ( c == ' a ' ) or ( c == ' e ' ) or ( c == ' i ' ) or ( c == ' o ' ) or ( c == ' u ' ) ) ; NEW_LINE DEDENT def removeVowels ( str ) : NEW_LINE INDENT print ( str [ 0 ] , end = " " ) ; NEW_LINE for i in range ( 1 , len ( str ) ) : NEW_LINE INDENT if ( ( is_vow ( str [ i - 1 ] ) != True ) or ( is_vow ( str [ i ] ) != True ) ) : NEW_LINE INDENT print ( str [ i ] , end = " " ) ; NEW_LINE DEDENT DEDENT DEDENT str = " ▁ geeks ▁ for ▁ geeks " ; NEW_LINE removeVowels ( str ) ; NEW_LINE