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!
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
Craig StantonCourses Plus Student 3,555 Points
Help solving disemvowel exercise the way Treehouse wants
I cannot for the life of me figure out how to solve this simple question. I have a solution (attached) that works for any string I enter when testing in Python (ie. it removes all the vowels of the word). However, Treehouse doesn't recognize this.
I understand that I may not have used the simplest code, but it works and the instructions say to solve any way I want.
Any help is appreciated
def disemvowel(word): word = word.lower() vowels = list("aeiou") for char in vowels: if char in word: word = word.replace(char, "") return word
Jennifer NordellTreehouse Teacher
Hi there! Your code just needs some slight adjustments. What if I added this statement to the instructions? Do this task without changing the original casing of the word. For example, if I send in "Balloon", I would expect to get back "Blln". Instead, what your code gives back is "blln".
Take another shot with this hint in mind!