My code is not working properly


#1



https://www.codecademy.com/courses/python-intermediate-en-rCQKw/1/2?curriculum_id=4f89dab3d788890003000096


My code should remove all vowels out of the string passed in. Instead it removes all of the vowels exceot for the vowels in the "Words". I don't have any any errors but I am not gettting the desired outcome


Replace this line with your code. 
def anti_vowel(text):
    x = list('aeiouAEIOU')
    list_txt = list(text)
    print list_txt
    for i in list_txt:
        if i in x:
            list_txt.remove(i)
    return ''.join(list_txt)
                
print anti_vowel('Hey look words')


#2

The above can have a negative impact on the iteration of the list. .remove() is not necessarily the best tool for this job unless we start iterating from the right hand side. That I'll leave for you to research.

String are iterables, so we need not convert the inputs to a list. Just use the string.

    result = []
    for x in text:
        if x in 'aeiouAEIOU":
            result.append(x)
    return "".join(result)