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

Help with disemvowel.py .. seems to work in workspace.. but "Bummer! Hmm.. got back letters I wasn't expecting

Hello.. can't figure out why this wouldn't pass. I tested in workspace and seems to working fine.

disemvowel.py
def disemvowel(word):
    word_list = list(word)
    vowels = "aeiou"
    for vowel in vowels:
        while True:
            try:
                word_list.remove(vowel)
            except ValueError:
                break
    for vowel in vowels:
        while True:
            try:
                word_list.remove(vowel.upper())
            except ValueError:
                break
    return word_list    

3 Answers

Steven Parker
Steven Parker
231,236 Points

Your return value is the wrong type.

It's easy to misinterpret the results when testing challenges externally.

In this case, the challenge is expecting a string but you are returning a list.

Thanks Steven. I changed the last statement to "return str(word_list)", but still getting the same error !!

Bummer! Hmm, got back letters I wasn't expecting!

Steven Parker
Steven Parker
231,236 Points

You can't convert a list into a string that way. But you could do it using "join".

Yes!. That fixed it. Thank you for your suggestion.