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

How do i approach this problem?

Not quite sure if i'm in even on the right track. Any help would be appreciated!

disemvowel.py
def disemvowel(word):
    vowels = ['a','e','i','o','u']
    letters= ", ".split(word)
    for letter in letters:
        if letter.lower() in vowels:
            letters.pop(letter)
    "".join(letters)

    return word
Dave Faliskie
Dave Faliskie
17,793 Points

Maybe try something with .replace() and your existing vowels list.

1 Answer

Pete P
Pete P
7,613 Points

Double check the documentation on .pop(). When using it, the parameter you give it is an integer representing the index of the character you wish to pop off the list. You cannot place a 'string' into the function. I agree with Dave, maybe try using .replace()