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 trialIan Cole
454 PointsDisemvowel Confusion
I'm completely lost at this point, I checked the one other question and I guess I just didn't understand what they were saying. Any help?
def disemvowel(word):
bad_letters = ["A", "E", "I", "O", "U"]
word_list = list(word)
for item in word_list:
if item in bad_letters:
word_list.remove(item)
return word
2 Answers
Steven Parker
231,248 PointsYou're pretty close, here's a few hints:
- the code modifies "word_list" but then returns "word" — which has not changed
- altering an iterator while it is controlling a loop can cause items to be skipped over
- the instructions say to "be sure to look for both uppercase and lowercase vowels!"
Rich Donnellan
Treehouse Moderator 27,696 PointsHmmm ... there are actually 12 pages worth ?: