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

Daniel Smith
Daniel Smith
10,172 Points

I dont know why but my code works in other IDEs but not here..

here are the versions i used that worked elsewhere: def disemvowel(word): word_list=list(word) new_word_list=[] for e in word_list: if e not in ('aeiouAEIOU'): new_word_list.append(e) word_list=new_word_list new_word=''.join(word_list) print(new_word)

and:

def disemvowel(word): word=[e for e in word if e not in ('aeiouAEIOU')] new_word=''.join(word) print(new_word)

disemvowel.py
def disemvowel(word):
    word_list=list(word)
    new_word_list=[]
    for e in word_list:
        if e not in ('aeiouAEIOU'):
            new_word_list.append(e)
    word_list=new_word_list
    new_word=''.join(word_list)
    print(new_word)

2 Answers

Your function does exactly what the challenge asks for. You just need to return new_word. Currently all your doing is printing it to the console.

Daniel Smith
Daniel Smith
10,172 Points

ahh thanks! i get confused with those two often

Np, been there and done that plenty of times.