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 trialYoel Dovid Cohen
13,405 Pointswhat am I doing wrong
There is a SyntaxError on Line 4. What am I doing wrong? Thanks in advance
def disemvowel(word):
word_list = list(word)
for item in word_list:
elif item.lower() = "a"
del item
elif item.lower() = "e":
del item
elif item.lower() = "i":
del item
elif item.lower() = "o":
del item
elif item.lower() = "u":
del item
return word
3 Answers
Nicholas Tan
Courses Plus Student 8,562 Pointschange your elif item.lower() = "a" to if item.lower() = "a"
Sydney O'Reilly
3,183 PointsYour if/elif/else statement needs an "if" as the first statement. I don't think they can all be "elif"! You're also missing a piece of punctuation in that statement on line 4.
Also, at the end, you're returning your variable "word". Are you sure you're making changes to that variable they way this is written? :)
Nicholas Tan
Courses Plus Student 8,562 Pointstry this to be very clear
def disemvowel(word):
word_list = list(word)
for item in word_list:
if item.lower() = "a":
del item
elif item.lower() = "e":
del item
elif item.lower() = "i":
del item
elif item.lower() = "o":
del item
elif item.lower() = "u":
del item
return word
Yoel Dovid Cohen
13,405 PointsThank you. I tried this but their was still a syntax error on line 4. Happy new year.
Yoel Dovid Cohen
13,405 PointsYoel Dovid Cohen
13,405 PointsI tried it but it didn't work. Thank you.