I wrote a function to remove vowels in a given string.
def anti_vowel(text):
text = list(text)
vowel = 'aeiou'
for letter in text:
if letter.lower() in vowel:
text.remove(letter)
return ''.join(text)
It doesn't remove all of the vowels, when I input 'Hey look Words!' the output is 'Hy lk Words!'
Why doesn't this code remove all vowels in the input?