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 trialak37
2,344 PointsDisemvowel Excercise
Not getting the right answer. Can anyone please help?
def disemvowel(word):
vowels = ['a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U']
word_list = list(word)
for letter in word:
for vowel in vowels:
try:
word.remove(vowel)
except ValueError:
continue
word = "".join(word_list)
return word
2 Answers
seekwiser
2,127 PointsCould be the letter in word loop. As you are removing a vowel in the word, that loop is no longer correct?
Puffy wuff
9,573 PointsHi Ali Looks like you are trying to use .remove() on a string in line 9. Try changing word to word_list. Hope this helps - I was stuck on this one for ages! :)