Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Python Python Collections (2016, retired 2019) Lists Disemvowel

eestsaid
eestsaid
1,311 Points

Need help with disemvowel challenge

Team - having trouble with disemvowal code challenge which is part of the python collections unit. Code is below. It would be helpful to get a hint or indication if I'm on the right path - no completed code if that's ok.

Thanks for your help.

disemvowel.py
def disemvowel(word):
    while True: #while loop to iterate through word and remove vowels
        user_word.remove(vowels)
    return word


user_word = input("Please type in a word. ") #user input for word
user_word = user_word.upper() #change input to upper case
user_word = user_word.split() #change input to a list to allow
vowels = ["a", "e", "i", "o", "u"] #make list of items to be removed
disemvowel(user_word) #call function

1 Answer

Steven Parker
Steven Parker
220,974 Points

You've got some bits that could be part of a solution, but not in the right place. For the challenge, all the code needs to be inside the function. And you won't need to call the function yourself (the challenge does that).

eestsaid
eestsaid
1,311 Points

Thanks Steven ... again :)