I'm going through some exercises in CodeAcademy. In one they ask you to write a function to remove all the vowels from a string. Apparently my function works with different texts, but it's not working with: "Hey look Words!". That's weird. Which could be my error? My code:
def anti_vowel(text):
vowels = ['a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U']
letters = []
for char in text:
letters.append(char)
for i in vowels:
for j in letters:
if i==j:
letters.remove(j)
new_text = ''.join(letters)
print new_text