python3 vowels and consonants filter

def anti_vowel(c):
    newstr = c
    vowels = ('a', 'e', 'i', 'o', 'u')
    for x in c.lower():
        if x in vowels:
            newstr = newstr.replace(x,"")

    return newstr

4.33
3

                                    def eliminate_consonants(x):
        vowels= ['a','e','i','o','u']
        for char in x:
            if char in vowels:
                print(char,end = "")

eliminate_consonants('mississippi')

4.33 (3 Votes)
0
4
7
AboAmmar 55 points

                                    letterList = ['a', 'b', 'c', 'd']
vowelList = []

for letter in letterList:
    if letter in 'aeiou':
        vowelList.append(letter)

4 (7 Votes)
0
4.5
4
EarthmeLon 150 points

                                    class Vowels(object):
    def __init__(self, vowelList):
        self.vowelList = vowelList

        lettersList = self.vowelList.s.split(",")
        self.vowelList = [letter for letter in self.lettersList if letter in 'aeiou']

4.5 (4 Votes)
0
3
1
Mihaela 105 points

                                    def getVowels(text):

vowel_letters = []
vowel_list = ['a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U',]

for vowels in text:
    if vowels in vowel_list:
        vowel_letters.append(vowels)

return vowel_letters

print(getVowels('Hi, How are you today!'))
## Output: ['i', 'o', 'a', 'e', 'o', 'u', 'o', 'a']

3 (1 Votes)
0
4.33
6
JakeParis 85 points

                                    def anti_vowel(text):
  new_text = ""
  for i in text:
    if i == 'a' or i == 'A':
      pass
    elif i == 'e' or i == 'E':
      pass
    elif i == 'I' or i == 'i':
      pass
    elif i == 'o' or i == 'O':
      pass
    elif i == 'u' or i == 'U':
      pass
    else:
      new_text = new_text + i
  return new_text

print anti_vowel('Hey look Words!')

4.33 (6 Votes)
0
Are there any code examples left?
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source