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

Brandon Cushman
Brandon Cushman
880 Points

I do not understand how to execute this challenge..

In my opinion this was kind of a big leap from the just reviewing lists and I feel I did not learn enough to really understand what to do here. In some other questions for this challenge I have seen .join used when we have not even learned how to use that. I have also seen blank strings being used in some cases and I don't recall learning that either. In any case, I am having a lot of trouble how to get this code to work. We are trying to remove the vowels from the word and then returning the word at the end.. Any help and explanation would be awesome. Maybe I totally blanked and forgot these parts but I have python for beginners twice through and have not found these explained.

disemvowel.py
def disemvowel(word):
    vowels = ['a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U']
    elist = []

    for letter in word:
        if letter not in vowels:
            elist.appened(letter)

2 Answers

james south
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
james south
Front End Web Development Techdegree Graduate 33,271 Points

your algorithm is fine you just need to return elist joined into a string. join is covered in python basics, there is a challenge with ice cream sundae flavors that uses it. join is called on the delimiting string with the collection to be joined as the argument, so like ', '.join(collection) would join the elements in collection separated by a comma and a space. in this case the empty string is your delimiter since you're joining into a word, so ''.join(collection).

Brandon Cushman
Brandon Cushman
880 Points

Wow, thank you so much.. I don't know why I forgot that section.. just reading the ice cream part jogged my memory.. I need to review sections better next time.. thank you again!