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 trialSavannah Logan
974 PointsMy code seems to work perfect in workspace but it is still no passing the test. anyone else having this problem?
I have tried it a few different ways but keep getting the same error that a few unwanted letters keep appearing...
def disemvowel(word):
word_list = list(word)
for letter in word:
if letter.lower() in 'aeiou':
word_list.remove(letter)
return ''.join(word)
2 Answers
Abdishakur Hassan
3,585 PointsYou need to reasign the original Word to the join method instead of Only returning it.
Word = ''. Join (word_list)
Martin Fallon
14,693 PointsYou could return the join as well, however you need to use it on 'world_list' and not on 'word' since you have applied the remove method to 'word_list' and not 'word'.
return ''.join(word_list)
instead of
return ''.join(word)