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

Weird bug(?) in disemvowel

I think this code is supposed to work, but it's not accepted (and no indication about the possible error, just a plain "bummer"). I just can't figure out what the problem could be. Now, here's the funny thing: if I simply return the word_lst, without converting it back to a string, then it accepts the solution.

def disemvowel(word):    
    word_lst = list(word)
    for vowel in "aeiou":
        while True:
            try:
                word_lst.remove(vowel)
            except ValueError:
                break
    # return word_lst is accepted, but this throws an error    
    return "".join(word_lst)

This version (returning a string) is also accepted, just as expected:

def disemvowel(word):
    output_string = ""
    for character in word:
        if character not in "aeiou":
            output_string += character
    return output_string

2 Answers

William Li
PLUS
William Li
Courses Plus Student 26,868 Points

yep, this particular code challenge is buggy, We've reported the issue to TTH support, hopefully it'll get fixed soon.

For what's worth, the coolest thing of all is that, As of now, You can pass the code challenge without writing or changing a single line of code, just press the check work button and you're passed. Credited to Jennifer Nordell for the finding.

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

Yes, I reported this as soon as I found it. However, it happened to be right in the middle of the holidays but hopefully they'll have this fixed as soon as everyone is back! :thumbsup:

Ok, thanks! :)

Peter Trefren
Peter Trefren
13,898 Points

It looks like the input test word has uppercase vowels in it.