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

issues completing the disemvowel challange of "Python Collections"

Can anybody explain me why this code is being rejected? I ran it a couple of times on my PC and it does exactly what it should do.

def disemvowel(word):
    process = list(word)
    new_word = []

    for letter in process:
        if (letter.lower() == 'a' or letter.lower() == 'e' or letter.lower() == 'i' or letter.lower() == 'o' or letter.lower() == 'u'):
            continue
        else:
            new_word.append(letter)

    word = ''.join(new_word)
    return word

Thanks in advance!

1 Answer

Paul Ehizuelen Jr.
Paul Ehizuelen Jr.
4,379 Points

I copy and pasted it into the challenge and it passed no problem. Try again, also good job!

Thank you very much, Paul! I tried it again pasting my code from above and it worked!