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 trialSanjay Noronha
7,296 PointsMy code works but am still getting an error:
I tested this out in my terminal, please.
def disemvowel(word):
#loop through the vowels
for vowel in "AEIOU":
# while the vowel exists in the word
while vowel in word.upper():
# remove vowel from word
word = word.upper().replace(vowel,"")
return word
2 Answers
Christopher Shaw
Python Web Development Techdegree Graduate 58,248 PointsWhile you are removing the vowels, you are also canging the returned word to uppercase. This is why it is failing. Look for both upper and lowercase vowels, but do not change the case of the letters that are returned.
Sanjay Noronha
7,296 PointsThanks a lot Christopher. You are absolutely right. All good now.