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

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
229,644 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 :)