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 trialSuresh N
743 PointsHi, This is challenge task. The below code works well in Workspace , but throws an EOF error when used inside challenge
def disemvowel(word):
word = input("Tell me a word:")
print("The word you entered is: {} ".format(word))
word_list = list(word)
vowel = "aeiouAEIOU"
for letters in vowel:
try:
word_list.remove(letters)
except ValueError as err:
continue
word = "".join(word_list) print("The word after removing vowels looks like: {}".format(word)) return word
disemvowel("word")
def disemvowel(word):
try:
word = input("Tell me a word:")
except EOFerror as err:
print("No input received")
print("The word you entered is: {} ".format(word))
word_list = list(word)
vowel = "aeiouAEIOU"
for letters in vowel:
try:
word_list.remove(letters)
except ValueError as err:
continue
word = "".join(word_list)
print("The word after removing vowels looks like: {}".format(word))
return word
disemvowel("word")
1 Answer
Suresh N
743 PointsThanks Kris. I will update my code.
KRIS NIKOLAISEN
54,971 PointsKRIS NIKOLAISEN
54,971 PointsI tried it in a workspace and entered 'cheese' and the vowels weren't removed.
Tell me a word:cheese
The word you entered is: cheese
The word after removing vowels looks like: chese