Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Python Collections (2016, retired 2019) Lists Disemvowel

Hmm, got back letters I wasn't expecting! Called disemvowel('AiDxBCm') and expected 'DxBCm'. Got back 'kyXcDxBCm'

getting error, its running ok in workspace ==> Hmm, got back letters I wasn't expecting! Called disemvowel('AiDxBCm') and expected 'DxBCm'. Got back 'kyXcDxBCm'

disemvowel.py
word_list=[]
vowel_list = ['A','a','E','e','I','i','O','o','U','u']

def disemvowel(text):
    for letter in range(0,len(text)):
        word_list.append(text[letter])
        if letter == 'i':  
            letter +=1     
    for i in vowel_list:
        for j in word_list:
            if i == j:
                word_list.remove(j)
    word_string = "".join(word_list)
    return(word_string) 

#text = "fariva"
#disemvowel(text)

1 Answer

Louise St. Germain
Louise St. Germain
19,424 Points

Hi Mina,

I answered this on your other thread already - let me know if there are still problems once you have a look. Thanks!