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

Joel holsinger
Joel holsinger
2,345 Points

Can't figure out why it wont remove the vowel? It keeps returning the original word.

I keep getting the original word back with all the vowels. What should I do differently? Any help is appreciated.

disemvowel.py
vowels = ('a', 'e', 'i', 'o', 'u')

def disemvowel(word):
    word.lower()

    for letter in word:
        if letter in vowels:
          word.remove(letter)


    return word

1 Answer

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

Hi there! The remove function is not usable on a string. It is, however, usable on a list. Here is the Python documentation for strings. If you want to use the remove method, you'll first need to convert your string to a list.

Hope this helps! :sparkles: