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

Matt Boylan
Matt Boylan
3,355 Points

Disemvowel not passing, even though I appear to be getting the correct results on testing.

As stated in the title, I'm not exactly sure where I'm going wrong.

disemvowel.py
def disemvowel(word):
    vowels = "aeiou"
    ourWord = []
    for letter in word:
      ourWord.append(letter)

    for letter in vowels:
        while True:
          try:
              ourWord.remove(letter)
          except ValueError:
              break

    returningWord = "".join(ourWord)
    return returningWord
Tony Martin
Tony Martin
5,570 Points

EDIT: UPPERCASE vowels!!! (just solved this for myself as well reading through the forums. )

As a side note, I believe you can also skip the first for loop you have in favor of:

ourWord = list(word)

I think... Based on my solution to this problem though, yours is by far better than what I came up with ;)

1 Answer

Hi! According to the moderators, this challenge is buggy, I've already asked about it: https://teamtreehouse.com/community/weird-bug-in-disemvowel

(In that post you might also check out the solution, which is more concise, e.g. uses the list() method to construct a list of characters from the input string, without a loop)