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

Craig Stanton
PLUS
Craig Stanton
Courses Plus Student 3,555 Points

Help solving disemvowel exercise the way Treehouse wants

Hello,

I cannot for the life of me figure out how to solve this simple question. I have a solution (attached) that works for any string I enter when testing in Python (ie. it removes all the vowels of the word). However, Treehouse doesn't recognize this.

I understand that I may not have used the simplest code, but it works and the instructions say to solve any way I want.

Any help is appreciated

disemvowel.py
def disemvowel(word):
    word = word.lower()
    vowels = list("aeiou")
    for char in vowels:
        if char in word:
            word = word.replace(char, "")
    return word

1 Answer

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there! Your code just needs some slight adjustments. What if I added this statement to the instructions? Do this task without changing the original casing of the word. For example, if I send in "Balloon", I would expect to get back "Blln". Instead, what your code gives back is "blln".

Take another shot with this hint in mind! :sparkles: