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 trialhuyen 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,469 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,469 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,469 PointsAlexander Davison
65,469 PointsDid you read the other answers?
Alexander Davison
65,469 PointsAlexander Davison
65,469 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