Not able to code for removing the vowels in 8/15


def anti_vowel(text):
for i in text:
for c in "aeiouAEIOU":
if i == c:
print c
print i



try to define a separate function to test if the letter in the text is a vowel. If it is, then return True, else, return False. Call that function from inside of the anti_vowel(text) function. :wink:



def anti_vowel(text):
x= "aeiouAEIOU"
for c in text:
for c in x:
text= text.replace(c,'')
return text

this worked for me


Thank you very much kasianowak, helped me a lot! Only one tiny suggestion: Is it possible there's a quotation mark missing in line 5 of your post?

def anti_vowel(text):
    x = "aeiouAEIOU"
    for c in text:
         for c in x:
            text = text.replace(c,"")
    return text


Another example of code:

def anti_vowel(text):
vowels = "aeiouAEIOU"
new_text = ""
for i in range(len(text)):
k = 0
for j in range(len(vowels)):
if(text[i] == vowels[j]):
k += 1
if(k == 0):
new_text = new_text + text[i]
return new_text