Program to accept a Strings which contains all the Vowels | Function to to check that a string contains all vowels ; Hash Array of size 5 such that the index 0 , 1 , 2 , 3 and 4 represent the vowels a , e , i , o and u ; Loop the string to mark the vowels which are present ; Loop to check if there is any vowel which is not present in the string ; Function to to check that a string contains all vowels ; Driver Code
def checkIfAllVowels ( string ) : NEW_LINE INDENT hash = [ 0 ] * 5 ; NEW_LINE for i in range ( len ( string ) ) : NEW_LINE INDENT if ( string [ i ] == ' A ' or string [ i ] == ' a ' ) : NEW_LINE INDENT hash [ 0 ] = 1 ; NEW_LINE DEDENT elif ( string [ i ] == ' E ' or string [ i ] == ' e ' ) : NEW_LINE INDENT hash [ 1 ] = 1 ; NEW_LINE DEDENT elif ( string [ i ] == ' I ' or string [ i ] == ' i ' ) : NEW_LINE INDENT hash [ 2 ] = 1 ; NEW_LINE DEDENT elif ( string [ i ] == ' O ' or string [ i ] == ' o ' ) : NEW_LINE INDENT hash [ 3 ] = 1 ; NEW_LINE DEDENT elif ( string [ i ] == ' U ' or string [ i ] == ' u ' ) : NEW_LINE INDENT hash [ 4 ] = 1 ; NEW_LINE DEDENT DEDENT for i in range ( 5 ) : NEW_LINE INDENT if ( hash [ i ] == 0 ) : NEW_LINE INDENT return 1 ; NEW_LINE DEDENT DEDENT return 0 ; NEW_LINE DEDENT def checkIfAllVowelsArePresent ( string ) : NEW_LINE INDENT if ( checkIfAllVowels ( string ) ) : NEW_LINE INDENT print ( " Not ▁ Accepted " ) ; NEW_LINE DEDENT else : NEW_LINE INDENT print ( " Accepted " ) ; NEW_LINE DEDENT DEDENT if __name__ == " _ _ main _ _ " : NEW_LINE INDENT string = " aeioubc " ; NEW_LINE checkIfAllVowelsArePresent ( string ) ; NEW_LINE DEDENT