Hey all, I've been trying to get this code to work for an hour or two now and am not sure how to replace the old string with a new one that has the vowel removed via my for loop.
string = "Hello aeiouy" def anti_vowel(text): x = "" vowels = ["a", "e", "i", "o", "u"] for i in vowels: x = (text.replace(i, "")) print x anti_vowel(string)
This code will print each iteration of the "for" loop without the "replace"d vowel. My problem lies in the fact that I'm not sure how to loop through each new string and then assign it to the:
x = ""
to create my final product.
I tried to do:
x = (text.replace(i, "")) + x
but that only concatenates each string to gether giving me a long list of each version of the strings with the vowels taken out.