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

The code for disemvowel appears to be correct. But, not sure why it is not letting me through.

def disemvowel(word):

newstr = word
my_vowels = ['a', 'e', 'i', 'o', 'u']


for letter in word.lower():
    if letter in my_vowels:
        newstr = newstr.replace(letter, "")


return newstr
disemvowel.py
def disemvowel(word):

    newstr = word
    my_vowels = ['a', 'e', 'i', 'o', 'u']


    for letter in word.lower():
        if letter in my_vowels:
            newstr = newstr.replace(letter, "")


    return newstr

1 Answer

Steven Parker
Steven Parker
231,007 Points

The function needs to remove both upper and lower case vowels, but this code appears to only remove those in lower case.

Greg Kaleka
Greg Kaleka
39,021 Points

This might be giving away too much, but here's an extra hint: you're checking lowercase and uppercase vowels, but you're only replacing lowercase vowels.

Got it worked! Thanks Steven!

Steven Parker
Steven Parker
231,007 Points

Harihar Kandula — Glad to help. You can mark the question solved by choosing a "best answer".
And happy coding!