1def anti_vowel(c):
2 newstr = c
3 vowels = ('a', 'e', 'i', 'o', 'u')
4 for x in c.lower():
5 if x in vowels:
6 newstr = newstr.replace(x,"")
7
8 return newstr
9
1def eliminate_consonants(x):
2 vowels= ['a','e','i','o','u']
3 for char in x:
4 if char in vowels:
5 print(char,end = "")
6
7eliminate_consonants('mississippi')
8
1class Vowels(object):
2 def __init__(self, vowelList):
3 self.vowelList = vowelList
4
5 lettersList = self.vowelList.s.split(",")
6 self.vowelList = [letter for letter in self.lettersList if letter in 'aeiou']
7
1letterList = ['a', 'b', 'c', 'd']
2vowelList = []
3
4for letter in letterList:
5 if letter in 'aeiou':
6 vowelList.append(letter)
7
1def anti_vowel(text):
2 new_text = ""
3 for i in text:
4 if i == 'a' or i == 'A':
5 pass
6 elif i == 'e' or i == 'E':
7 pass
8 elif i == 'I' or i == 'i':
9 pass
10 elif i == 'o' or i == 'O':
11 pass
12 elif i == 'u' or i == 'U':
13 pass
14 else:
15 new_text = new_text + i
16 return new_text
17
18print anti_vowel('Hey look Words!')
19
1def getVowels(text):
2
3vowel_letters = []
4vowel_list = ['a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U',]
5
6for vowels in text:
7 if vowels in vowel_list:
8 vowel_letters.append(vowels)
9
10return vowel_letters
11
12print(getVowels('Hi, How are you today!'))
13## Output: ['i', 'o', 'a', 'e', 'o', 'u', 'o', 'a']
14