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 trialSebastien Lemay
1,397 Pointsdisemvowel: Really don't understand the problem
Hi, I am trying to do the disemvowel challenge. I don't understand my code problem. Here's the code:
def disemvowel(word):
word_in_list = list(word)
vowels = ["a", "e", "i", "o", "u", "A", "E", "I", "O", "U"]
for letter in word_in_list.copy():
if letter in vowels:
word_in_list.remove(letter)
word = "".join(word_in_list)
return word
The weird thing is I tried to put a print(word) just before the return, and it printed the word without vowels.
2 Answers
Grigorij Schleifer
10,365 PointsHey Sebastian, your code works well. Try to reload the page.
Sebastien Lemay
1,397 PointsThanks
Grigorij Schleifer
10,365 PointsYou are welcome, Sebastian! Keep up the hard work