Maybe this is what you are looking for -
def all_vowels(string):
v = {'a', 'e', 'i', 'o', 'u'}
if set(string.split()).intersection(v)==v:
return True
else:
return False
all_vowels('abcd')
#False
all_vowels('aeiou')
#True
This is more efficient that you string search -
- This takes an intersection between the set of characters in the string and the set of characters in the list of vowels.
- If the intersection is the same, as the set of vowels, then it means the string has all the vowels and it returns True.
- This saves u from 2 nested for loops for each string.