Given a string, the task is check if every vowel is present or not. We consider a vowel to be present if it is present in upper case or lower case. i.e. ‘a’, ‘e’, ‘i’.’o’, ‘u’ or ‘A’, ‘E’, ‘I’, ‘O’, ‘U’ .
Input : geeksforgeeks Output : Not Accepted All vowels except 'o' are not present Input : ABeeIghiObhkUul Output : Accepted All vowels are present
Approach : Firstly, create set of vowels using
set() function. Check for each character of the string is vowel or not, if vowel then add into the set s. After coming out of the loop, check length of the set s, if length of set s is equal to the length of the vowels set then string is accepted otherwise not.
Below is the implementation :
Alternate Implementation :
Alternate Implementation 2.0 :
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.