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!
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 trial
Alwen Nyikadzanzwa1,541 Points
please help Iam having problems with this question
please help. Iam failing to go through this question
def disemvowel(word): return word word.lower() for letter in word: if letter == "a": word.remove("a") elif letter == ("e"): word.remove("e") elif letter == ("i"): word.remove("i") elif letter == ("o"): word.remove("o") elif letter == ("u"): word.remove("u")
Clayton PerszykTreehouse Moderator 48,602 Points
a return statement breaks out of the function call and nothing after is processed.
Steven Parker224,924 Points
Clayton makes a good point, you'll probably want to save the return for the end of the function.
But two other things you might need to be aware of:
- calling the "lower" method does not change the string, you need to assign it to something
- modifying an iterator within the loop can cause items to be skipped over, use a copy to control the loop