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 trialAdriano Junior
5,065 PointsDISEMVOWELing in Python Collections
I don't understand why my code is being rejected, in this Code Challenge. They said we could resolve it however we liked. And this works. I really don't see where is the problem. Can someone help?
def remove_all_vowels():
word = list(input("Write any word you like: "))
print("Your selected word is now: ", word)
while True:
vowel = input("Please insert the vowel you would like to be removed.\n(Vowels = a, e, i, o, u or A, E, I, O, U)\n> ")
def disemvowel(word):
try:
word.remove(vowel)
except ValueError:
pass
return word
disemvowel(word)
if vowel.upper() == "NONE":
print("Your final word, without vowels, is: ", word)
break
print("You now have: ", word)
remove_all_vowels()
1 Answer
Alexander Davison
65,469 PointsWhy doesn't you code work? Well, let's see...
- Why is your function called
remove_all_vowels
and notdisemvowel
? - Why are you
input
ting the word? - Why are you
print
ing the result? - And a bajillion other reasons...
Read this other post. (You also might want to completely start over.)
Adriano Junior
5,065 PointsAdriano Junior
5,065 PointsThanks. ;)