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.
- Modify the string such that it contains all vowels at least once
- Python Regex - Program to accept string starting with vowel
- Python Regex | Program to accept string ending with alphanumeric character
- PyQt5 QSpinbox - Checking if accept drops is enabled or not
- PyQt5 QSpinbox - How to enable accept drops
- PyQt5 QCalendarWidget - Setting accept drops property
- PyQt5 QCalendarWidget - Getting accept drops property
- PyQt5 QCalendarWidget - Setting Date Edit (Pop-Up) Accept Delay Property
- PyQt5 QCalendarWidget - Getting Date Edit (Pop-Up) Accept Delay
- Functions that accept variable length key value pair as arguments
- Python program to count number of vowels using sets in given string
- Python program to check if a string contains all unique characters
- Python program to find the frequency of the elements which are common in a list of strings
- Python program to check if the list contains three consecutive common numbers in Python
- Python | Count and display vowels in a string
- Python | Alternate vowels and consonents in String
- Python - Replace Consonents by i, Vowels by j
- Python - Split String on vowels
- Python - Replace vowels by next vowel
- Python - Replace vowels in a string with a specific character K
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.