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 trialAjith Kampillil
4,513 PointsHelp with disemvowel.py .. seems to work in workspace.. but "Bummer! Hmm.. got back letters I wasn't expecting
Hello.. can't figure out why this wouldn't pass. I tested in workspace and seems to working fine.
def disemvowel(word):
word_list = list(word)
vowels = "aeiou"
for vowel in vowels:
while True:
try:
word_list.remove(vowel)
except ValueError:
break
for vowel in vowels:
while True:
try:
word_list.remove(vowel.upper())
except ValueError:
break
return word_list
3 Answers
Steven Parker
231,236 PointsYour return value is the wrong type.
It's easy to misinterpret the results when testing challenges externally.
In this case, the challenge is expecting a string but you are returning a list.
Ajith Kampillil
4,513 PointsThanks Steven. I changed the last statement to "return str(word_list)", but still getting the same error !!
Bummer! Hmm, got back letters I wasn't expecting!
Steven Parker
231,236 PointsYou can't convert a list into a string that way. But you could do it using "join".
Ajith Kampillil
4,513 PointsYes!. That fixed it. Thank you for your suggestion.