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 trialGabriel Catani
3,897 PointsMy script is not passing in the challenge, but it wors on python IDE
def disemvowel(word):
vowels = ['a', 'e', 'i', 'o', 'u']
word = word.lower()
word = list(word)
letters_to_remove = []
for i in word:
if i in vowels:
letters_to_remove.append(i)
for i in letters_to_remove:
if i in word:
word.remove(i)
return word
def disemvowel(word):
vowels = ['a', 'e', 'i', 'o', 'u']
word = word.lower()
word = list(word)
letters_to_remove = []
for i in word:
if i in vowels:
letters_to_remove.append(i)
for i in letters_to_remove:
if i in word:
word.remove(i)
return word
2 Answers
Jennifer Nordell
Treehouse TeacherHi there! You're almost there. But there are a couple of things going on which is making it not return the value expected. The value returned should be a string, but your code is returning a list. This is a great time to use the join
method.
Also, you are altering the original capitalization of the word. If I were to send in the word "Treehouse", I would expect to get back "Trhs", but instead I'm getting back this: ['t', 'r', 'h', 's']
.
I think you can get it with these hints, but let me know if you're still stuck!
Gabriel Catani
3,897 PointsJennifer Thank you! I totally missed the return value format! I wasn't seeing any vowels in the returned value, but it still was a list. Thank you very much for your time helping me!
And Steven thank you also for the heads up! I'll try to stick with workspaces and code challenges screens for the exercises.
I heard the community in treehouse was great, but now i can attest to that!
Let's get back to Python :)
Steven Parker
231,269 PointsSteven Parker
231,269 PointsBe careful about testing a challenge in an external REPL or IDE.
If you have misunderstood the challenge, it's also very likely that you will misinterpret the results.