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

Not sure what is wrong with my answer

What is wrong with the answer ?

disemvowel.py
def disemvowel(word):

    p = list(word)
    q = []

    for i in p:
        if i.lower() == 'a' or \
           i.lower() == 'e' or \
           i.lower() == 'i' or \
           i.lower() == 'o' or \
           i.lower() == 'u':
            continue

        q.append(i)

    word=q
    return word

1 Answer

Hi James

Thanks for the reply.

I even tried replacing "word = q" with "word = str(q)". Execution still fails.

This is the error message which I am seeing. Seems my logic is not complete and it has nothing to do with return type string or list.

Hmm, got back letters I wasn't expecting!