Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

huyen nguyen
850 PointsHelp me with my code
what's missing in my code
def disemvowel(word):
x=word.lower()
word_list=list(x)
z=["a", "e", "i", "o", "u"]
for i in word_list:
if i in z:
new= word_list.remove(i)
return str(new)
2 Answers

Alexander Davison
65,456 PointsHi there!
I just answered a question very similar to this.
Can you check it out here? Can't work out why my disemvowel function won't work

huyen nguyen
850 PointsHi Alexander, Why don't we need a 'return' command following if command? can we write return result+=letter, instead of adding 'return result' at the last line?

Alexander Davison
65,456 PointsActually, we can't. This is the most simple form I can think of (unless you count list comprehensions).
huyen nguyen
850 Pointshuyen nguyen
850 PointsI tried to copy and paste your code but it didn't work. How weird!
Alexander Davison
65,456 PointsAlexander Davison
65,456 PointsDid you read the other answers?
Alexander Davison
65,456 PointsAlexander Davison
65,456 PointsHere's the passing code:
As the other comments show below, my
disemvowel
function forgot to check both uppercase and lowercase letters. Read the comments below and you'll see